问题分析:ufsystem数据库中表ua_iadentity中ifather,ichildid小于出错数据库中所对应的主表和 子表。 用sql执行语句可解决:(ufdata_008_2010改为你所修改的帐套名) 发货单重复 use ufsystem update ua_identity set ifatherid=(select max(dlid)from ufdata_008_2010..dispatchlist),ichildid=(select max(idlsid)from ufdata_008_2010..dispatchlists) where cacc_id='帐套号' and cvouchtype='DISPATCH' 销售发票重复 use ufsystem update ua_identity set ifatherid=(select max(sbvid)from ufdata_008_2010..salebillvouch),ichildid=(select max(autoid)from ufdata_008_2010..salebillvouchs) where cacc_id='帐套号' and cvouchtype='billvouch'
(如果出错的是其他类型的单据,可以根据红色的字段,与下列ua_identity表中所对应的数据库表进行替换,下面的主子表代表出错的数据库中的表,不是ufsystem数据库中的。)
use ufsystem update ua_identity set ifatherid=(select max(dlid)from ufdata_111_2012..dispatchlist),ichildid=(select max(idlsid)from ufdata_111_2012..dispatchlists) where cacc_id='111' and cvouchtype='DISPATCH'
问题:按保存时提示说:单据保存失败,不能在具有唯一索引...的对象..中出入重复键的行。
解决:最大单据号检测修复,更改入库单的最大单据号的语句
Update UFSystem..UA_Identity
Set iFatherId=(Select Max(ID) As ID From UFDATA_111_2012..RdRecord),
iChildId=(Select Max(AutoID) As AutoID From UFDATA_111_2012..RdRecords)
Where cAcc_Id='111' And cVouchType='rd'
应付应收单最大单据号
Update UFSystem..UA_Identity
Set iFatherId=(Select Max(ID) As IID From UFDATA_111_2012..ap_closebill),
iChildId=(Select Max(AutoID) As ID From UFDATA_111_2012..ap_closebills)
Where cAcc_Id='111' And cVouchType='sk'
PS: as 代表重命名列名或表名 111为要修改的帐套名 ufdata_111_2012为要修改的帐套数据库
————————————————
版权声明:本文为CSDN博主「jamesdodo」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。