SQL Server 2008 R2 supports Nested transaction but I am using SQL Server 2008 Standard Edition. Please let me know whether it supports nested transaction?
Asked
Active
Viewed 240 times
1
-
1*SQL Server 2008 R2 supports Nested transaction* - that's wrong – May 30 '13 at 13:44
1 Answers
4
No version of SQL Server supports nested transactions. It appears to, but it doesn't
Why?
ROLLBACK
can rollback all transactions- Some errors "doom" the transaction stack
SET XACT_ABORT ON
does an implicit rollback
So even with savepoints and named transactions, you still can't truly nest. For example, the links below invalidate this pattern with savepoints: http://rusanu.com/2009/06/11/exception-handling-and-nested-transactions/ . I'd hate to rely on this because you really need SET XACT_ABORT ON
in SQL Server
Hence my answer here to enable stored proc nesting: Nested stored procedures containing TRY CATCH ROLLBACK pattern?
This links onto the authoritative Paul S. Randal: http://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-2630-nested-transactions-are-real/