实例:
用系统常量@@error在执行每一个sql语句后的值来判断:
begin transaction
delete ...
if @@error<>0
begin
rollback transaction
return
end
insert into ...
if @@error<>0
begin
rollback transaction
return
end
commit transaction