1.查找锁表的进程
from sys.dm_tran_locks where resource_type='OBJECT'
2.查看进程的sql语句
dbcc inputbuffer(52)
3.终止当前的进程
Set @spid = 52 --锁表进程
declare @sql varchar(1000)
set @sql='kill '+cast(@spid as varchar)
exec(@sql)
1.查找锁表的进程
from sys.dm_tran_locks where resource_type='OBJECT'
2.查看进程的sql语句
dbcc inputbuffer(52)
3.终止当前的进程