Quantcast
Channel: Answers for "Rolling back the whole procedure (all statements)"
Viewing all articles
Browse latest Browse all 4

Answer by Kev Riley

$
0
0
Your answer is in one of the links you gave.. [MSDN][1]: >In stored procedures, ROLLBACK TRANSACTION statements without a savepoint\_name or transaction\_name roll back all statements to the outermost BEGIN TRANSACTION. A ROLLBACK TRANSACTION statement in a stored procedure that causes @@TRANCOUNT to have a different value when the stored procedure completes than the @@TRANCOUNT value when the stored procedure was called produces an informational message. This message does not affect subsequent processing. So in other words, a ROLLBACK in a stored procedure will rollback all statements that you started within a transaction - now whether or not you put the whole SP into a transaction is a different story - depending on the length and complexity of the SP - you may cause yourself more issues by locking resources. [1]: http://msdn.microsoft.com/en-us/library/ms181299.aspx

Viewing all articles
Browse latest Browse all 4

Trending Articles