on_tsql_error option [compatibility]

Controls error-handling in stored procedures.

Allowed values

String (see below for allowed values)

Default

Conditional

Continue for jConnect connections

Remarks

This option controls error handling in stored procedures.

  • Stop   Stop execution immediately upon finding an error.

  • Conditional   If the procedure uses ON EXCEPTION RESUME, and the statement following the error handles the error, continue, otherwise exit.

  • Continue   Continue execution, regardless of the following statement. If there are multiple errors, the first error encountered in the stored procedure is returned.

Both the 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 supercedes 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