set xact_abort ON 在事务中,若出现错误,系统即默认回滚事务
begin tran
insert into RemoteDBLink.UFSystem.dbo.at_basedata_hold (BD_ID,ACC_ID)
select '111','222'
select * from RemoteDBLink.UFSystem.dbo.at_basedata_hold
if @@error = 0
commit tran
else
rollback tran
set xact_abort ON 在事务中,若出现错误,系统即默认回滚事务
begin tran
insert into RemoteDBLink.UFSystem.dbo.at_basedata_hold (BD_ID,ACC_ID)
select '111','222'
select * from RemoteDBLink.UFSystem.dbo.at_basedata_hold
if @@error = 0
commit tran
else
rollback tran
转载于:https://www.cnblogs.com/wuyifu/archive/2013/01/25/2875947.html