sql解除死锁

select spId
from master..SysProcesses
where db_Name(dbID) = 'Tb_axxxxx'
and spId <> @@SpId
and dbID <> 0

--先查后解除


declare @spid int
Set @spid = 149 --锁表进程
declare @sql varchar(1000)
set @sql='kill '+cast(@spid as varchar)
exec(@sql)

posted @ 2021-11-12 16:07  212的s  阅读(217)  评论(0编辑  收藏  举报