旗舰版存货核算期末结账提示“违反了PRIMARY KEY约束'pk ICInvBal'。不能在对象'dbo.ICInvBal'中插入重复键”?

【问题描述】
旗舰版存货核算期末结账提示“违反了PRIMARY KEY约束'pk ICInvBal'。不能在对象'dbo.ICInvBal'中插入重复键”?
【原因分析】
该现象可能出现在反结账重新结账,或结账不成功再次结账时。该问题的原因为余额表中存在以后期间的数据。
【解决方案】
declare @FCurrentYear int
declare @FCurrentPeriod int
select @FCurrentYear = FValue from t_SystemProfile where FCategory = 'IC' and FKey = 'currentyear'
select @FCurrentPeriod = FValue from t_SystemProfile where FCategory = 'IC' and FKey = 'currentperiod'
delete from ICInvBal where FYear * 1000 + FPeriod > @FCurrentYear * 1000 + @FCurrentPer
旗舰版存货核算期末结账提示“违反了PRIMARY KEY约束'pk ICInvBal'。不能在对象'dbo.ICInvBal'中插入重复键”?
【问题描述】旗舰版存货核算期末结账提示“违反了PRIMARY KEY约束'pk ICInvBal'。不能在对象'dbo.ICInvBal'中插入重复键...
点击下载文档文档为doc格式
声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。如若本站内容侵犯了原著者的合法权益,可联系本站删除。
上一篇
已经是第一篇



