放到一起执行一下就可以了甚至可以:
delete A where colx = 0.0 update from A where col1 = "..." insert B select * from A where ...
delete A where colx = 0.0 update from A where col1 = "..." insert B select * from A where ...
调试欢乐多
放到一个事务里,是否能满足你的要求:
begin transaction
-- sql 1:
delete from A
where colx = 0.0;--sql 2:
update from A
where col1 = "..."--sql 3:
insert into B
select *
from A
where ...commit
create proc [sp name]
as
sql 1:
delete from A
where colx = 0.0;sql 2:
update from A
where col1 = "..."sql 3:
insert into B
select *
from A
where ...
end
go