有问题文章留言 看内容决定收费与免费
另外接收数据库质疑 勒索病毒数据恢复等项目。

在前台销售商品单独打折,结算时报错“不能在对象t_rm_protion_flow中插入重复键”。

【问】在前台销售商品单独打折,结算时报错“不能在对象t_rm_protion_flow中插入重复键”。
【适用版本】专卖店8 【模块】零售管理 【点击数】34
【知识编号】Z2013060800024
【问题描述】违反了 PRIMARY KEY 约束 ‘pk_t_rm_protion_flow’。不能在对象 ‘t_rm_protion_flow’ 中插入重复键。No changes made to database.INSERT INTO t_rm_protion_flow ( flow_no, pro_id, branch_no, item_no, sale_qty, source_price, sale_price, send_money, special_type, sheet_no, pro_des, give_type, vip_flag, dec_rate, card_id, card_no, oper_id, oper_date, com_flag ) VALUES ( ”, 1, ‘000001’, ‘Q1066’, 1.00, 92.0000, 82.8000, 9.2000, ‘pd’, ”, ‘单品折扣,价格从[92.00]更改为[82.80]’, ‘0’, ‘0’, 0.00, ”, ”, ‘1001’, ‘2013-3-26 9:32:53.875’, ‘0’ ) 

【答】 执行以下语句修复自增列即可。use isszmv7 –可改成相应的数据库名
go
declare @tablename varchar(100)
declare test_cur cursor for
select object_name(id) from syscolumns
where status=128
open test_cur
fetch test_cur into @tablename
while @@fetch_status=0
begin
DBCC CHECKIDENT (@tablename, RESEED)
fetch test_cur into @tablename
end
close test_cur

赞(0)
未经允许不得转载:思迅软件知识库 » 在前台销售商品单独打折,结算时报错“不能在对象t_rm_protion_flow中插入重复键”。
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址