Skip to content

Instantly share code, notes, and snippets.

@rajanand
Last active December 30, 2015 13:49
Show Gist options
  • Save rajanand/7837769 to your computer and use it in GitHub Desktop.
Save rajanand/7837769 to your computer and use it in GitHub Desktop.
To close all the connection of a database in SQL Server.
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