create proc usp_updateA
as
begin
select * into #tempA from TB1 where id='A' --1、建立临时表
update #tempA set id='B',number=number*0.80 --2、处理更新值
insert into TB2 --3、放入新表
select * from #tempA
end
as
begin
select * into #tempA from TB1 where id='A' --1、建立临时表
update #tempA set id='B',number=number*0.80 --2、处理更新值
insert into TB2 --3、放入新表
select * from #tempA
end
你这个没有体现的循环, 可能查询出来的值会有很多,我需要的是查询出来多少条在第二张表里面就新增多少条数据。