解决方案: |
解决方案1.执行如下语句,修改第一种情况:
UPDate a
set a.cInvCode=c.cInvCode,a.iBVID=c.AutoID
from ap_detail a,salebillvouch b,salebillvouchs c
Where a.ccovouchid=b.csbvcode
and a.ccovouchtype=b.cvouchtype
and b.sbvid=c.sbvid
and a.cinvcode is null
and a.ccovouchtype in ('26','27','01','02','28','29')
2.执行如下语句,修改第二种情况:
UPDate a
set a.cInvCode=c.cInvCode,a.iBVID=c.AutoID
from ap_detail a,ufdata_006_2002..salebillvouch b,ufdata_006_2002..salebillvouchs c
Where a.ccovouchid=b.csbvcode
and a.ccovouchtype=b.cvouchtype
and b.sbvid=c.sbvid and a.cinvcode is null
and a.ccovouchtype in ('26','27','01','02','28','29') |