mssql 死锁方面的一些资料。

-- 1.查询死锁的进程,表名
select   request_session_id   spid,OBJECT_NAME(resource_associated_entity_id) as  tableName   ,*
 
from   sys.dm_tran_locks where resource_type='OBJECT'  and OBJECT_NAME(resource_associated_entity_id) is not null


-- 2. 查询引起死锁的电脑
select * from sys.dm_exec_sessions where session_id in (72,81)

 

posted @ 2017-05-25 10:03  不能失败  阅读(195)  评论(0编辑  收藏  举报