Question Regarding Nested Procs!

  • Hello Everybody,

    Hopefully I am clear here if not pls let me know.

    I have a proc where i am calling a another proc inside main now my question is

    Let's name Main Proc and Inner PRoc

    Now when it comes to the step in Main Proc where it executes inner proc does it wait untill the Inner Proc is successfull or it just executes and goes to the next step in the Main proc.

    Next Question..how to handle the errors in the inner proc especially while calling inside a proc.

    if i do this

    IF @@ERROR <> 0

       BEGIN

          -- Rollback the transaction

                               ROLLBACK

          -- Raise an error and return

        RAISERROR ('Error in Inner Proc', 16, 1)

        RETURN

       END

      

    in the inner proc on error does it come back to the main proc or what happens..

    Your Help is greatly appreciated.

    thanks in advance

  • You need to read EXECUTE topic in BOL.

    @return_status is what you gonna be interested in the most.

    _____________
    Code for TallyGenerator

Viewing 2 posts - 1 through 1 (of 1 total)

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