步骤1.查看锁表进程
2.杀死进程
--1.查询锁表进程 spid、和被锁表名称 tableName
select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName
from sys.dm_tran_locks
where resource_type='OBJECT' and OBJECT_NAME(resource_associated_entity_id) is not null --2.查询出 kill+锁表进程
select 'kill '+ cast(request_session_id as varchar(20)) spid
from sys.dm_tran_locks
where resource_type='OBJECT' and OBJECT_NAME(resource_associated_entity_id) is not null --3.直接杀掉
kill 91
kill 52
kill 94
kill 56
kill 91
kill 70
kill 52
kill 94
kill 56
kill 56
kill 52
kill 94
kill 91
kill 70
把第二个查询列直接复制粘贴运行即可。