How to check table locks

select  
    object_name(P.object_id) as TableName, 
    resource_type, resource_description
from
    sys.dm_tran_locks L
    join sys.partitions P on L.resource_associated_entity_id = p.hobt_id
原文地址:https://www.cnblogs.com/ankier/p/2666291.html