K3wise12.3保存凭证时提示代码或名称在系统中已被使用
金蝶云社区-GDK
GDK
0人赞赏了该文章 642次浏览 未经作者许可,禁止转载编辑于2016年07月15日 10:32:40


select distinct(fvoucherid) AS Foldid,IDENTITY(int,1,1) as fnewid into #tmpa from t_voucher----建立新旧凭证内码对应关系
update a set a.fvoucherid=b.fnewid from t_voucher a , #tmpa b where a.fvoucherid=b.foldid-----用新内码替换旧内码
update a set a.fvoucherid=b.fnewid from t_voucherentry a , #tmpa b where a.fvoucherid=b.foldid
update t_identity set fnext=(select max(fvoucherid) from t_voucher)+1 where fname='t_voucher'

这个代码试了不管用,你们看看有什么需要修改的,懂数据库的的高手求求你们了