I have one store procedure that will need to call a second stored procedure passing over one input parameter. Due to the nature of both stored procs I’d like to be able to use transactions and commit to ensure all elements are carried out before being committed.
If the relevant contents of the first stored proc are within the transaction aswell as the call to the 2nd stored proc, will this suffice or is it the case that the events of the 2nd sp would be commited seperately???
I hope that makes sense, & thanks for in advance for the help.
Yes they will be part of the same transaction. In fact even if you started a separate transaction inside the second procedure, nested transactions in SQL do not work. The whole thing is committed or rolled back.