Thursday, February 10, 2011

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

I found the quickest way to kill the processes of SQL Server.
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%.

No comments:

Post a Comment