• Jacob Wilkins (5/6/2015)


    Yeah, running that ALTER DATABASE command requires an X lock on the DB in question, so you effectively have to be the only session using the DB.

    You could run it using WITH ROLLBACK IMMEDIATE to get around that, but you'd obviously want to make sure nothing "important" was running in the DB. I'm paranoid, so I'd probably make it a maintenance window, to be safest.

    Cheers!

    Thanks! I really couldn't remember.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning