Why Use Nested Transaction In Sql Server

sql-server, transactions

Solution

From Books Online :

Explicit transactions can be nested. This is primarily intended to support transactions in stored procedures that can be called either from a process already in a transaction or from processes that have no active transaction.

http://msdn.microsoft.com/en-us/library/ms189336%28v=sql.105%29.aspx

Problem

What is use of nested transaction in sql server. As we know that there is no scope of inner transaction, if we committed inner transaction and rollback by outer transaction then outer transaction will rollback inner transaction so what is use of inner transaction Please explain me. Thanks - Girijesh Kuamr

Original source