As we all know, the error information of SQL statements can be found in the sys. messages table, for example, if the execution statement is in try... catch, we can obtain the error information through the following methods. The SQL statement is as follows: BEGINTRYTRYBEGINCATCH (4000) ERROR_NUMBER (), @ errorseverityERROR_SEVERITY (), @ error
As we all know, the error information of SQL statements can be found in the sys. messages table, for example, if the execution statement is in try... catch, we can obtain the error information through the following methods. The SQL statement is as follows: BEGIN TRY BEGIN CATCH (4000) ERROR_NUMBER (), @ errorseverity = ERROR_SEVERITY (), @ error
As we all know, the error messages of SQL statements can be found in the sys. messages table.
For example:
If the execution statement is in try... catch, we can get the error information through the following methods. The SQL statement is as follows:
Begin try trybegin catch (4000) ERROR_NUMBER (), @ errorseverity = ERROR_SEVERITY (), @ errorstate = ERROR_STATE (), @ errormessage = ERROR_MESSAGE () SELECT @ errornumber, @ errorseverity, @ errorstate, @ errormessageRAISERROR (,); end catch, website space, server space, Hong Kong VM