ACID 的转账
begin tran
begin try
declare @errorsum int=0
update Bank set balance=balance-900 where Cid=’0001′
set @errorSum=@errorSum+@@error
update Bank set balance=balance+900 where Cid=’0002′
set @errorSum=@errorSum+@@error
commit
print ‘提交!!’
end try
begin catch
rollback
print ‘回滚!’
end catch
转载于:https://www.cnblogs.com/yijieyufu/p/11355724.html