--/*******采购入库登记单位商品关系
if @djlxbs=‘116‘ begin create table #t_dwsp ( dwbh char(11) null default ‘‘, spid char(11) null default ‘‘, spid1 char(11) null default ‘‘ ) insert into #t_dwsp(dwbh,spid,spid1) select @dwbh,a.spid,isnull(b.spid,‘@#$%^&*@#$%‘) as spid1 from #t_djmx a left join wyf_dwspgx b(nolock) on a.spid=b.spid and [email protected] insert into wyf_dwspgx(dwbh,spid) select dwbh,spid from #t_dwsp where spid1=‘@#$%^&*@#$%‘ drop table #t_dwsp --删除缺货登记 insert into xsqhdj_his(rq,spid,shl,dwbh,username,beizhu) select rq,spid,shl,dwbh,username,beizhu from xsqhdj where spid in(select distinct spid from #t_djmx) delete from xsqhdj where spid in(select distinct spid from #t_djmx) end
时间: 2024-11-08 04:55:52