How To Kill Processes Using Activity Monitor In SQL Server

I was working on a project and got to a situation where the sessions were generated randomly on the SQL Server machine. We had to kill all the related sessions on the SQL Server machine before performing our own task. One simple method was to kill the related sessions using the Activity Monitor.

Note: Please be cautious while killing processes in your production environment.

How to kill all processes using Activity Monitor?

Step 1: Connect to your SQL Server instance. Select ‘Activity Monitor’ from the menu. 

Kill Processes Using Activity Monitor







Step 2: Expand the ‘Session ID’, ‘Application’, and ‘Blocked By’ tabs to check your session ID and related information.

Step 3: Right-click on the respective SPID and click on ‘Kill Process’ 

Kill Processes Using Activity Monitor 2

You can repeat the same for the session you are willing to kill.

Additionally, we can find the active sessions using the sp_who2 active command. Most of the DBAs use the sp_who2 active to fetch the blocking session and kill them.

Now that you have learned to kill the process using the Activity Monitor, my personal perception will be to use sp_who2 active to fetch and kill them in case the motive was to find the blocking session.

0 comments:

Post a Comment