Wednesday, July 09, 2008

Distributed Transaction Coordinator orphaned transactions in SQL 2005

Thes types of transactions can cause resource contention and show up in sp_who2 as being blocked by spid -2. You can kill them if you know the Unit of Work (a guid) that identifies them. You can find the guids using the following query in SQL 2005:

SQL 2005 using system table

SELECT DISTINCT(req_transactionUOW)
FROM sys.syslockinfo
WHERE req_spid = -2
AND req_transactionUOW <&gt; '00000000-0000-0000-0000-000000000000'


You would kill the UOW with the same Kill command from SQL as you would a spid.

KILL '00000000-0000-0000-0000-000000000000'


This should clear the transactions and remove any resource contention that they may be having.
Sources: SQL Authority


Enjoy!