SQL Server deadlock

use the below sql to find the deadlock:

select    
    request_session_id spid,   
    OBJECT_NAME(resource_associated_entity_id) tableName    
from    
    sys.dm_tran_locks   
where    
    resource_type='OBJECT'

 

then kill spid.

 

Sometimes, the deadlock is caused by the connections created by SQL studio management. you need to close all these connections.

posted @ 2016-08-26 21:41  damonluffy  阅读(208)  评论(0编辑  收藏  举报