Error Handling and set Options

Transact-SQL error-handling techniques include capturing return status from stored procedures, defining customized return values from stored procedures, passing parameters from a procedure to its caller, and retrieving reports from global variables.

set options customize the results display, show processing statistics, and provide other diagnostic aids for debugging your Transact-SQL programs.

The raiserror and print statements, in combination with control-of-flow language, can direct error messages to a Transact-SQL application. Developers can localize print and raiserror to use different languages.

All set options except showplan and char_convert take effect immediately.

See the Reference Manual: Commands.