alter procedure sp_test_tran
as
begin
SET XACT_ABORT ON --开启全部回滚(包括嵌套事务),关闭不会滚嵌套事务
----begin tran
insert into test_tran191 values ('one')
exec [temperp].paxbase.dbo.sp_test_tran '1234'
insert into test_t1(id) values ('two')
if @@error =0
begin
print 'commit tran '
commit tran
end
else
begin
print 'rollback tran '
rollback tran
end
end