金蝶/K3Wise 月末结账时候提示:违反违反了PRIMARYKEY约束,PK_POZnvBal,不能在对象POinvBal中插入重复键
生活随笔
收集整理的這篇文章主要介紹了
金蝶/K3Wise 月末结账时候提示:违反违反了PRIMARYKEY约束,PK_POZnvBal,不能在对象POinvBal中插入重复键
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
金蝶提示違反違反了PRIMARY KEY約束,PK_POZnvBal,不能在對象POinvBal中插入重復鍵
一般是手動或者通過插件對數據庫進行了刪除操作造成的
原因:一是部份物料已經不存在,二是表中存在有以后期間的記錄
--解決方案delete from poinvbal where?fitemid not in (select fitemid from t_icitem)?delete from poinvbal where fyear=( select fvalue from t_systemprofile where fcategory='ic' and fkey='currentyear' )?and fperiod>(select fvalue from t_systemprofile where fcategory='ic' and fkey='currentperiod')--例如:違反了PRIMARY KEY約束,PK_ICInvBal,不能在對象ICinvBal中插入重復鍵處理方法 --Fyear(當前賬期年) --Fperiod(當前賬期月)SELECT * FROM ?IcBal WHERE Fyear=2020 and Fperiod=1 --DELETE FROM IcBal WHERE Fyear=2020 and Fperiod=1SELECT * FROM ?IcinvBal WHERE Fyear=2020 and Fperiod=1 --DELETE FROM IcinvBal WHERE Fyear=2020 and Fperiod=1?
總結
以上是生活随笔為你收集整理的金蝶/K3Wise 月末结账时候提示:违反违反了PRIMARYKEY约束,PK_POZnvBal,不能在对象POinvBal中插入重复键的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 物料移动类型和后勤自动科目设置-转
- 下一篇: CentOS上安装 Docker-CE以