SQL Server查看被锁的表 - dead lock

select str(request_session_id ,4 ,0) as SPID
      ,convert(varchar(20) ,db_name(resource_database_id)) as db_name 
      ,resource_associated_entity_id
      ,O.name
      ,resource_type
      ,request_type
      ,request_mode
      ,request_status      
from   sys.dm_tran_locks as A   with (nolock)
left join sys.objects as O with (nolock) on A.resource_associated_entity_id=O.[object_id]
where  resource_type <> 'DATABASE'
posted @ 2017-02-04 11:15  CooMark  阅读(192)  评论(0)    收藏  举报