sql server 事务处理模板
set xact_abort on
begin try
begin tran
-- 这里写你自己的sql
commit tran
end try
begin catch
if (xact_state()) = -1
begin
rollback tran
end
if (xact_state()) = 0
begin
print '无需任何操作!'
end
if (xact_state()) = 1
begin
commit tran
end
end catch
exitproc:
标签:begin,end,tran,事务处理,server,sql,xact
From: https://www.cnblogs.com/fjn-blogs/p/17510572.html