码迷,mamicode.com
首页 > 数据库 > 详细

SQL Server deadlock

时间:2016-08-26 22:50:14      阅读:250      评论:0      收藏:0      [点我收藏+]

标签:

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.

SQL Server deadlock

标签:

原文地址:http://www.cnblogs.com/damonluffy/p/5811822.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!