0
点赞
收藏
分享

微信扫一扫

SQL SERVER的表一直查询卡住

debug时,在执行db还没完成的情况下,取消了,后面发现一张表content_kpi查询一直卡住

-- 结果为0
select count(*) from content_kpi with(nolock)
-- 一直卡住,查不了
select count(*) from content_kpi

解决:
表可能被锁住了

-- 结果为59
select   
    request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName   
from   
    sys.dm_tran_locks  
where   
    resource_type='OBJECT'
-- 干掉这个进程
KILL 59
举报

相关推荐

0 条评论