SQL SERVER – Quickest Way to – Kill All Threads – Kill All User Session – Kill All Processes

More than a year ago, I wrote how to kill all the processes running in SQL Server. Just a day ago, I found the quickest way to kill the processes of SQL Server. While searching online I found very similar methods to my previous method everywhere. Today in this article, I will write the quickest way to achieve the same goal.

Read here for older method of using cursor – SQL SERVER – Cursor to Kill All Process in Database.

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

Running above script will give following result.

Nonqualified transactions are being rolled back. Estimated rollback completion: 100%.

Reference : Pinal Dave (https://blog.sqlauthority.com)

SQL Scripts, SQL Utility
Previous Post
SQLAuthority News – Two Promotion to Help Community
Next Post
SQL SERVER – Introduction to Force Index Query Hints – Index Hint

Related Posts

Leave a Reply