操作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 <进程ID> ')  

 

相关文章:

  • 2021-12-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-26
猜你喜欢
  • 2021-06-03
  • 2021-06-16
  • 2021-08-07
相关资源
相似解决方案