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 );