Home >Database >Mysql Tutorial >由于无法在数据库 'TestNonContainedDB' 上放置锁 ALTER

由于无法在数据库 'TestNonContainedDB' 上放置锁 ALTER

WBOY
WBOYOriginal
2016-06-07 15:10:542074browse

Error: 消息5601,级别16,状态1,第1行,由于无法在数据库 'TestNonContainedDB' 上放置锁,ALTER DATABASE 失败。请稍后再试。消息5069,级别16,状态1,第一行ALTER DATABASE 语句失败。 对应的英文信息是:Msg 5061, Level 16, State 1, Line 1 ALTER DAT

Error:

消息5601,级别16,状态1,第1行,由于无法在数据库 'TestNonContainedDB' 上放置锁,ALTER DATABASE 失败。请稍后再试。消息5069,级别16,状态1,第一行ALTER DATABASE 语句失败。

对应的英文信息是:Msg 5061, Level 16, State 1, Line 1 ALTER DATABASE failed because a lock could not be placed on database 'TestNonContainedDB'. Try again later. Msg 5069, Level 16, State 1, Line 1 ALTER DATABASE statement failed.

 

Solution:

declare @kill varchar(8000) = '';
select @kill=@kill+'kill '+convert(varchar(5),spid)+';'
from master..sysprocesses
where dbid=db_id('WSS_Content_81');
exec (@kill);

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