7

Does sql server allow nested transactions? If so then whats the priority of transactions?

2 Answers 2

15

From the MSDN documentation on SQL Server. Nesting Transactions:

Committing inner transactions is ignored by the SQL Server Database Engine. The transaction is either committed or rolled back based on the action taken at the end of the outermost transaction. If the outer transaction is committed, the inner nested transactions are also committed. If the outer transaction is rolled back, then all inner transactions are also rolled back, regardless of whether or not the inner transactions were individually committed.

Sign up to request clarification or add additional context in comments.

Comments

4

Just to qualify this and directly answer the question, yes SQL Server does allow the nesting of transactions.

The quoted reference kindly provided by ichiban, details that the outcome of outermost transaction will determine whether or not nested transactions are committed.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.