Database Transaction lock information

Transaction lock

View the Transaction lock complete information using the following TSQL code.

select * 
FROM    sys.dm_tran_locks TL
LEFT JOIN sys.partitions SP 
ON SP.hobt_id = TL.resource_associated_entity_id
LEFT JOIN sys.objects O 
ON O.object_id = SP.object_id
LEFT JOIN sys.dm_exec_sessions S 
ON S.session_id = TL.request_session_id
LEFT JOIN sys.dm_tran_session_transactions ST 
ON S.session_id = ST.session_id
LEFT JOIN sys.dm_tran_active_transactions AT 
ON ST.transaction_id = AT.transaction_id
LEFT JOIN sys.dm_exec_connections C 
ON C.session_id = S.session_id
Database Transaction lock information was last modified: October 1st, 2017 by Justin Antony

About Justin Antony

Leave a Reply