Today, we worked on a new service request where our customer tried to modify a parameter of a new database, just a couple minutes after that they have created it.
During aprox. 5-10 minutes they were not able to modify this parameter after the database was created and our customer asked why.
Every time that they tried to change the value of this parameter they got the following error message:
How we found it:
If you want to automate this process using a script, for example, to change the containment parameter:
CREATE OR ALTER PROCEDURE ChangeStatus
ALTER DATABASE <databasename> set containment =partial
DECLARE @VALUE AS INT = -1
DECLARE @nTimes as INT = 0
SELECT @Value = (SELECT Containment FROM sys.databases WHERE name='databasename')
IF @VALUE <> 0 BREAK;
SET @nTimes = @ntimes +1
IF @Value = 0
PRINT 'Doing #'
WAITFOR DELAY '00:02:00'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.