![]() ![]() For more information, see TRY.CATCH (Transact-SQL). The TRY.CATCH construct also supports additional system functions (ERROR_LINE, ERROR_MESSAGE, ERROR_PROCEDURE, ERROR_SEVERITY, and ERROR_STATE) that return more error information than TRY.CATCH also supports an ERROR_NUMBER function that is not limited to returning the error number in the statement immediately after the statement that generated an error. Use the TRY.CATCH construct to handle errors. You can view the text associated with an error number in sys.messages.īecause is cleared and reset on each statement executed, check it immediately following the statement being verified, or save it to a local variable that can be checked later. ![]() If the error was one of the errors in the sys.messages catalog view, then contains the value from the _id column for that error. Returns an error number if the previous statement encountered an error. ![]() Returns 0 if the previous Transact-SQL statement encountered no errors. To view Transact-SQL syntax for SQL Server 2014 and earlier, see Previous versions documentation. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |