How It Works: Session/SPID (–2) for DTC Transactions


Moved from: bobsql.com

 

I have written on this subject before but it seems to come up from time to time, as it did again this week.  The Session (SPID) = –2 is just a place holder used by SQL Server to indicate that the DTC transaction is still active but there are no sessions enlisted/propagated into the transaction.

 

Here is how to reproduce the scenario.

Client creates and owns a DTC Transaction Client connects to SQL Server, and enlists in the DTC transaction. Connection does some work under the DTC transaction umbrella Client disconnects (or enlists in NULL)

The current