ON_TSQL_ERROR option [TSQL]

Function

Controls error-handling in stored procedures.

Allowed values

String. See Description for allowed values.

Default

CONDITIONAL

Description

This option controls error handling in stored procedures.

Both CONDITIONAL and CONTINUE settings for ON_TSQL_ERROR are used for Adaptive Server Enterprise compatibility, with CONTINUE most closely simulating Adaptive Server Enterprise behavior. The CONDITIONAL setting is recommended, particularly when developing new Transact-SQL stored procedures, as it allows errors to be reported earlier.

When this option is set to STOP or CONTINUE, it supersedes the setting of the CONTINUE_AFTER_RAISERROR option. However, when this option is set to CONDITIONAL (the default), behavior following a RAISERROR statement is determined by the setting of the CONTINUE_AFTER_RAISERROR option.

See also

CREATE PROCEDURE statement

CREATE PROCEDURE statement [T-SQL]

“CONTINUE_AFTER_RAISERROR option [TSQL]”

“Transact-SQL procedure language overview” in Appendix A, “Compatibility with Other Sybase Databases” in Reference: Building Blocks, Tables, and Procedures

Appendix A, “Compatibility with Other Sybase Databases” in Reference: Building Blocks, Tables, and Procedures