Results 1 to 3 of 3

Thread: Help On Performing Looping In Transaction

  1. #1
    Join Date
    Feb 2008
    Posts
    2

    Help On Performing Looping In Transaction

    I'm having issue with using cursor and executing store procedure in Transaction that involve multiple level. Hope that somebody can help. tq

    I have 3 store procedure, each one call the other inside the cursor looping.
    Basically I want to loop thru a cursor and call the second store procedure which in turn call loop thru its own cursor and call another store procedure that perform a insert/update task.

    Im keep getting the error

    Msg 266, Level 16, State 2, Procedure usp_ServiceOrder_CopyPostRequirement, Line 0
    Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 2, current count = 3.
    Msg 266, Level 16, State 2, Procedure usp_ServiceOrder_AmendOrder, Line 0
    Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 0, current count = 3.

    Please refer to the 3 attached sp files. The first called the 2nd and the 2nd called the 3rd. Your help is very much appreciated. Tq
    Attached Files Attached Files

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    On which rdbms?

  3. #3
    Join Date
    Feb 2008
    Posts
    2

    Re:DBMS

    Sorry, I should have mentioned earlier. Im using MS Sql Server 2005. Hope that you can help or advice. tq

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •