In my previous two blogs, I talked about how kill a session in SQL Server and how to kill multiple sessions in SQL Server. In this blog I will talk about how to kill all sessions of database in SQL Server.

The blog doesn’t promote this as best practice and would recommend not running it on production server until necessary.

The above query changes database user mode to singe_user which automatically kills all database sessions. The query then changes database user mode to multi_user allowing new database connections.

 

Regards

Ahmad Osama

Like us on FaceBook Join the fastest growing SQL Server group on FaceBook

Follow me on TwitterFollow me on FaceBook