#2
lgp7404012017-12-07 22:00
|
select FCODE,DDH,bxcode,bxTHICK,bxWIDTH,bxLONGTH,,scthick,scwidth,sclongth,drscl into #d_sjtmp from tb_原始数据_b where flayer=3 And gx=@gx And rtrim(ltrim(jlsjh_tb_原始数据))=@jlsjh
alter table #d_sjtmp add [id] [int] IDENTITY(1,1)
alter table #d_sjtmp add [jlsjh_tb_工资日报] [char(20)]
update #d_sjtmp set jlsjh_tb_工资日报=@日报sjh
select @d_sjCount=max(id) from #d_sjtmp
set @d_sjRec=1
while @d_sjRec<=@d_sjCount
if @D_xmCount<=@d_sjCount
begin
insert into tb_工资日报_b select * from #d_sjtmp where id=@d_sjRec
if @d_sjRec<=@D_xmCount
update tb_工资日报_b set xm=(select 代单号1 from #D_xm where id=@d_sjRec),zbjt=(select 代单号2 from #D_xm where id=@d_sjRec),gzje=(select 单号3 from #D_xm where id=@d_sjRec)
set @d_sjRec=@d_sjRec+1
end
else if @D_xmCount>@d_sjCount
begin
。。。。。。。
end
end
只有本站会员才能查看附件,请 登录
[此贴子已经被作者于2017-12-6 16:19编辑过]