Kill Process (sp_who2)

Posted: August 29, 2010 in SQL Server 2005

Identify SPID
To check which processes are affecting the server performance, run the following command:

sp_who2;

This shows all the sessions that are currently in the database. These are shown as SPID’s or server process Id’s. The first 50 records that are returned are are system SPIDs and user processes are SPID numbers after 50. When looking into the performace of the server, these SPIDs are most likely causing the issue.

Kill Process
To kill a process just enter the word kill followed by the SPID:

kill SPID;

The field Blkby will identify the SPID that is causing any blocks.

Lock Info
To view more details on the lock process just enter the follwing:

sp_lockinfo;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s