SQLserver查询锁表和解锁
1、查询锁表语句
select request_session_id spid,
OBJECT_NAME(resource_associated_entity_id) tableName
from sys.dm_tran_locks
where resource_type = 'OBJECT'
2、查看被锁语句
dbcc inputbuffer(spid);
3、强制解锁
kill spid
1、查询锁表语句
select request_session_id spid,
OBJECT_NAME(resource_associated_entity_id) tableName
from sys.dm_tran_locks
where resource_type = 'OBJECT'
2、查看被锁语句
dbcc inputbuffer(spid);
3、强制解锁
kill spid