Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
控制存储过程中的错误处理。
Stop 发现错误时立即停止执行。
Conditional 如果过程使用 ON EXCEPTION RESUME,则跟在错误后面的语句处理该错误,继续执行,否则就退出。
Continue 继续执行,无论后面是什么语句。如果有多个错误,则一旦存储过程完成将返回在该过程中所遇到的第一个错误。
Conditional
对 JConnect 连接,继续执行
可以为单个连接或 PUBLIC 设置此选项。您必须具有 SET ANY PUBLIC OPTION 系统特权才能为 PUBLIC 或者其他用户或角色设置此选项。
此选项控制存储过程和 Transact-SQL 批处理中的错误处理。此选项在 BEGIN...END 语句的 TRY 块中不起作用,错误处理行为已在 TRY 块中定义。
使用 on_tsql_error 的 Conditional 和 Continue 设置的目的都是为了与 Adaptive Server Enterprise 兼容,而 Continue 可最近似地模拟 Adaptive Server Enterprise 的行为。为了早一些报告错误,请在创建新的 Transact-SQL 存储过程时使用 Conditional 设置。
当此选项设置为 Stop 或 Continue 时,它会取代 continue_after_raiserror 选项的设置。然而,当此选项设置为 Conditional(缺省值)时,RAISERROR 语句后的行为由 continue_after_raiserror 选项的设置决定。