1.查询锁表信息
select request_session_id AS '锁表id',OBJECT_NAME(resource_associated_entity_id) AS '表名'
from sys.dm_tran_locks where resource_type='OBJECT'
2.查询锁表时执行的SQL,可以看下造成锁表的sql ,这个过程先不要解锁
DBCC INPUTBUFFER(锁表id)
3.杀死进程(解锁)
KILL 锁表id;
1.查询锁表信息
select request_session_id AS '锁表id',OBJECT_NAME(resource_associated_entity_id) AS '表名'
from sys.dm_tran_locks where resource_type='OBJECT'
2.查询锁表时执行的SQL,可以看下造成锁表的sql ,这个过程先不要解锁
DBCC INPUTBUFFER(锁表id)
3.杀死进程(解锁)
KILL 锁表id;