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