提问人: 提问时间:12/19/2022 最后编辑:Thom A 更新时间:12/19/2022 访问量:26
如何配置会话以在出现第一个错误时停止执行以下所有命令?
How to configure the session to stop executing all following commands on first error?
问:
假设我有一个脚本:
alter table ....
go
insert into ...
go
alter table ...
go
delete from ..
go
如何在此脚本的开头配置此会话,以便在四个命令中的任何一个引发任何错误时,跳过脚本中的所有后续命令?
我不想对这些命令本身做任何事情,例如添加“raiseerror”和try/catch等。我想做的就是在脚本的开头添加一些东西,以便“出错时中止”会自动发生。
答: 暂无答案
评论
XACT_ABORT