标签:时空
--/*******采购入库登记单位商品关系
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 b.dwbh=@dwbh 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
标签:时空
原文地址:http://bks2015.blog.51cto.com/9847303/1606039