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

【问题描述】
旗舰版存货核算期末结账提示“违反了PRIMARY KEY约束'pk_POInvBal'不能在对象'dbo.POInvBal'中插入重复键?

【原因分析】
原因1:虚仓余额表POInvBal中存在以后期间的数据。
原因2:虚仓余额表POInvBal中存在已被删除的物料。
【解决方案】
--针对原因1,可参考以下脚本执行处理:
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 POInvBal
旗舰版存货核算期末结账提示“违反了PRIMARY KEY约束'pk_POInvBal'不能在对象'dbo.POInvBal'中插入重复键?
【问题描述】旗舰版存货核算期末结账提示“违反了PRIMARY KEY约束'pk_POInvBal'不能在对象'dbo.POInvBal'中插入重复键?...
点击下载文档文档为doc格式
声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。如若本站内容侵犯了原著者的合法权益,可联系本站删除。
上一篇
已经是第一篇



