Clear all connections to a MSSQL database

Simple script to close all connections to a MSSQL database.

USE master;
GO
ALTER DATABASE dbName
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE;
GO
ALTER DATABASE dbName
SET MULTI_USER;
GO

Add a comment
(will not be published)
(include http://)