Friday, November 4, 2011

Different termination options to set sql server in single_user/offline mode

ALTER DATABASE [TestDB] SET
SINGLE_USER
-- RESTRICTED_USER
-- OFFLINE
WITH
-- ROLLBACK AFTER 5 SECONDS
ROLLBACK IMMEDIATE
-- NO_WAIT;