旗舰版存货核算期末结账提示“违反了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 + @FCurrentPeriod
delete from POInvBal where FYear * 1000 + FPeriod > @FCurrentYear * 1000 + @FCurrentPeriod
delete from ICBal where FYear * 1000 + FPeriod > @FCurrentYear * 1000 + @FCurrentPeriod
delete from ICVMIInvBal where FYear * 1000 + FPeriod > @FCurrentYear * 1000 + @FCurrentPeriod
【注意事项】
正式账套执行脚本前请先做好备份,建议待在测试账套中核实无误后再在正式账套中执行。
旗舰版存货核算期末结账提示“违反了PRIMARY KEY约束'pk ICInvBal'。不能在对象'dbo.ICInvBal'中插入重复键”?
本文2024-09-22 16:38:24发表“kis知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-kis-89240.html
- 鼎捷EAI整合規範文件V3.1.07 (集團).pdf
- 鼎捷OpenAPI應用場景說明_基礎資料.pdf
- 鼎捷OpenAPI應用場景說明_財務管理.pdf
- 鼎捷T100 API設計器使用手冊T100 APIDesigner(V1.0).docx
- 鼎新e-GoB2雲端ERP B2 線上課程E6-2應付票據整批郵寄 領取.pdf
- 鼎新e-GoB2雲端ERP B2 線上課程A4使用者建立權限設定.pdf
- 鼎新e-GoB2雲端ERP B2 線上課程C3會計開帳與會計傳票.pdf
- 鼎新e-GoB2雲端ERP B2 線上課程E6-1應付票據.pdf
- 鼎新e-GoB2雲端ERP B2 線上課程A5-1進銷存參數設定(初階篇).pdf
- 鼎新e-GoB2雲端ERP B2 線上課程D2帳款開帳與票據開帳.pdf