aspdotnet-suresh offers articles and tutorials,csharp dot net, articles and tutorials,VB.NET Articles,Gridview articles,code examples of 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

Close Kill All Active Database Connections in SQL Server

Dec 27, 2012

Here I will explain how to kill or close all active database connections in SQL Server.


In previous article I explained Get number of active connections to database in SQL Server, Joins in SQL Server and many articles relating to SQL Server.  Now I will explain how to close or kill all database connections in SQL Server.

In some situations we will get requirement like close or kill active database connections for that we can approach in different methods

First Method

Open SQL Server Management Studio and connect to your database server

Now select database server >> Right click on server >> Select Activity Monitor like as shown below 

Once we click on Activity Monitor all the details will open in right hand side like as shown below

Now click on Processes tab it will display all the session details in that select required session >> Right click on it and select Kill Process like as shown below 

In this way we can kill required database connection in SQL Server.

Second Method

If we use above method we need to close each connection of user separately instead of this we can use query to close all the database connections for that we need to write the query like as shown below

Whenever we run above query forcefully it will disconnect all the database connections and it will move our database mode to single user mode for that reason we need to move our database back to multi user mode. To convert single user to multi user we need to run the below query

In this way we can kill or close all the database connections in SQL Server.

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest,, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email


pragadesh said...


Give your Valuable Comments

Note: Only a member of this blog may post a comment.

© 2015 All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.