Because the lock ALTER cannot be placed on the database & #39; TestNonContainedDB & #39;

Source: Internet
Author: User
Error: Message 5601, level 16, status 1, 1st rows. ALTERDATABASE fails because the lock cannot be placed on the database TestNonContainedDB. Please try again later. Message 5069, level 16, status 1, the first line of ALTERDATABASE statement failed. The corresponding English information is: Msg5061, Level16, State1, Line1ALTERDAT

Error: Message 5601, level 16, status 1, 1st rows. alter database fails because the lock cannot be placed on the DATABASE 'testnoncontainerdb. Please try again later. Message 5069, level 16, status 1, the first line of alter database statement failed. The corresponding English information is: Msg 5061, Level 16, State 1, Line 1 ALTER DAT

Error:

Message 5601, level 16, status 1, 1st rows, alter database failed because the lock cannot be placed on the DATABASE 'testnoncontainerdb. Please try again later. Message 5069, level 16, status 1, the first line of alter database statement failed.

The corresponding English information is: Msg 5061, Level 16, State 1, Line 1 alter database failed because a lock cocould 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 );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.