Monthly Archives: September 2011

How to close all connections to a MSSQL database

This script closes all connections to MS SQL database USE master; GO ALTER DATABASE dbName SET SINGLE_USER WITH ROLLBACK IMMEDIATE; GO ALTER DATABASE dbName SET MULTI_USER; GO