Created
February 21, 2017 21:10
-
-
Save charlwillia6/76e28fcfb801c2eb56907bcb3d32dc57 to your computer and use it in GitHub Desktop.
Set SQL database to single user mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE master; | |
GO | |
ALTER DATABASE AdventureWorks2012 | |
SET SINGLE_USER | |
WITH ROLLBACK IMMEDIATE; | |
GO | |
ALTER DATABASE AdventureWorks2012 | |
SET READ_ONLY; | |
GO | |
ALTER DATABASE AdventureWorks2012 | |
SET MULTI_USER; | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment