Raise error and Begin try

  • If my stored procedure throws exception, I need to catch the error. I used Begin try and logged the error.But what happens is the procedure ends with success. Can we make it to fail when there is an exception?

  • Use RAISERROR in your CATCH block.

    John

  • great. I gave error in begin try block and catched it in catch block. It made it fail. Thanks

    In My Log table, the ErrorProcedure is not being captured when there is logical error or when the query fails. When that column would be filled?

  • I'm afraid I don't know what you mean. Please post your code.

    John

  • I am using the ErrorLog table given in MSDN. I will check the documentation first.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply