Last active
December 30, 2015 13:49
-
-
Save rajanand/7837769 to your computer and use it in GitHub Desktop.
To close all the connection of a database in SQL Server.
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 DatabaseName | |
SET OFFLINE WITH ROLLBACK IMMEDIATE | |
ALTER DATABASE DatabaseName | |
SET ONLINE | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment