没有问题。 SET XACT_ABORT on create table #Table1 (a tinyint)begin tran insert #table1 values(1) insert #table1 values(2) commit transelect * from #table1 drop table #table1
SET XACT_ABORT on 不会有错误阿如果实在不行,可以用下面来实现事务回滚,不用上面那句话。 begin tran insert into table values(@ss) if @@error<>0 begin rollback tran end commit tran
SET XACT_ABORT on create table #Table1 (a tinyint)begin tran
insert #table1 values(1)
insert #table1 values(2)
commit transelect * from #table1 drop table #table1
不会有错误阿如果实在不行,可以用下面来实现事务回滚,不用上面那句话。
begin tran
insert into table values(@ss)
if @@error<>0
begin
rollback tran
end
commit tran