TSQL to identify the transaction with the most locks

Published 31 July 07 07:25 AM | SQL Master 
SELECT request_session_id, COUNT (*) num_locks
FROM sys.dm_tran_locks
GROUP BY request_session_id 
ORDER BY count (*) DESC

Comments

# SQL Server Security, Performance & Tuning (SSQA.net) said on July 31, 2007 8:03 AM:

Yet another important factors that every DBA needs to concerned about table & index fragmentation

# SSQA.net - SqlServer-QA.net said on July 31, 2007 12:21 PM:

SELECT request_session_id, COUNT (*) num_locks FROM sys.dm_tran_locks GROUP BY request_session_id ORDER

# Other SQL Server Blogs around the Web said on August 6, 2007 9:53 PM:

SELECT request_session_id, COUNT (*) num_locks FROM sys.dm_tran_locks GROUP BY request_session_id ORDER

Anonymous comments are disabled

About SQL Master

**__________________________________** SQL Server MVP, Sr. DBA & industry expert. - Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it. It is also a power and you will gain by sharing it.