Home » Uncategorized » How to close all connections to a MSSQL database

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

One Response to How to close all connections to a MSSQL database

  1. I didn’t know where to find this info then kbaoom it was here.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>