已超过了锁请求超时时段。 (Microsoft SQL Server,错误: 1222)

操作SQLServer数据库时。遇到这种问题:已超过了锁请求超时时段。 (Microsoft SQL Server,错误: 1222)

经过查找材料了解为资源抢占,照成死锁,杀死进程就OK了。详细操作例如以下:

select spId
  from master..SysProcesses
 where db_Name(dbID) = '数据库名称'
   and spId <> @@SpId
   and dbID <> 0
上面语句是获取进程ID,以下就是依据ID杀死对应进程
exec ('Kill '+spId(进程ID))

原文地址:https://www.cnblogs.com/blfshiye/p/5251121.html