Home  >  Article  >  Database  >  已超过了锁请求超时时段。(MicrosoftSQLServer,错误:1222)

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

WBOY
WBOYOriginal
2016-06-07 16:10:163325browse

操作SQLServer数据库时,遇到这样的问题:已超过了锁请求超时时段。 (Microsoft SQL Server,错误: 1222) 经过查找材料了解为资源抢占,照成死锁,杀死进程就OK了,具体操作如下: select spId from master..SysProcesses where db_Name(dbID) = 数据库名称 a

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

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

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn