DBA > Job Interview Questions > Microsoft SQL Server FAQs

What does the ERROR_PROCEDURE() function return?

More DBA job interview questions and answers at http://dba.fyicenter.com/Interview-Questions/

(Continued from previous question...)

What does the ERROR_PROCEDURE() function return?

Answer
The name of the stored procedure that caused an error.

Explanation
The ERROR_PROCEDURE() function is placed in the catch block of a TRY..CATCH construct and returns the name of the procedure that caused an error to be thrown.

(Continued on next question...)

Other Job Interview Questions