Hi, we have a database restore script that runs an ALTER DATABASE [Database] SET RESTRICTED_USER WITH ROLLBACK IMMEDIATE command. The next statement is a WAITFOR DELAY with 30 seconds. This is to ensure any non compliant connections are
killed before continuing.
However, I'm wondering if the WAITFOR is actually necessary? Would the ALTER DATABASE command not block until all connections have been killed?
View Complete Post