Define function available in catch block of SQL

Below are the different functions use inside CATCH block:-
(1)ERROR_NUMBER:- The number of the error that occurred. This is similar to @@ERROR except that it will return the same number for the duration of the CATCH block.

(2)ERROR_MESSAGE:- The complete text of the error message including any substitute parameters such as object names.

(3)ERROR_LINE:- This is the line number of the batch or stored procedure where the error occurred.

(4)ERROR_SEVERITY:- This is the severity of the error. The CATCH block only fires for errors with severity 11 or higher. Error severity from 11 to 16 are typically user or code errors. Severity levels from 17 to 25 are usually software or hardware errors where processing may not be able to continue.

(5)ERROR_STATE:- This is sometimes used by the system to return more information about the error.

(6)ERROR_PROCEDURE:- If the error was generated inside a stored procedure this will hold the name of the procedure.

Comments

Popular posts from this blog

Google to FTS Syntax Cheat Sheet

@@rowcount

Sql Index