Friday, March 9, 2012

Quick Question on SP and Transactions

Hello
Say if I have a Store Procedure that creates a named
transaction.
Can I have a different SP which commits or rollbacks it ?
ThanksYes, if the second SP was called by the first SP from within the same
transaction. In that case, it would all be in the same calling stack and
transaction space.
However, I generally don't like the idea of having transaction bounds cross
procedures like that. I find that it inevitably leads to transaction and
logic errors since programmers will get conufsed about how the transactions
interact with each other.
"Jimbo" <anonymous@.discussions.microsoft.com> wrote in message
news:414c01c488fb$bda7dc00$a301280a@.phx.gbl...
> Hello
> Say if I have a Store Procedure that creates a named
> transaction.
> Can I have a different SP which commits or rollbacks it ?
> Thanks
>

No comments:

Post a Comment