--查询 被事务锁定的表
--spid :事务 编号
--tableName:锁定表名
SELECT request_session_id spid,OBJECT_NAME(resource_associated_entity_id)tableName
FROM sys.dm_tran_locksWHERE resource_type='OBJECT '
--清除
--查询 被事务锁定的表
--spid :事务 编号
--tableName:锁定表名
SELECT request_session_id spid,OBJECT_NAME(resource_associated_entity_id)tableName
FROM sys.dm_tran_locks--清除