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 such as @@error. 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.
set options customize the display of results, show processing statistics, and provide other diagnostic aids for debugging your Transact-SQL programs. All set options except showplan and char_convert take effect immediately.
See the Reference Manual: Commands.