Tuesday, October 6, 2020

NAV/BC - View Locked Tables

Useful for identifying if a specific routine is locking up tables


 select distinct TableName from(

SELECT OBJECT_NAME(p.OBJECT_ID) AS TableName,


resource_type, resource_description


FROM sys.dm_tran_locks as l


JOIN sys.partitions as p ON l.resource_associated_entity_id = p.hobt_id) as locks


No comments:

Post a Comment