Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Another sp_who3

By Kristian Ask,

This script will use the standard sp_who2 to fill a temporary table with currently run processes rather than copying the code from that sp_who2 to my own.

The difference from others are that it is also getting the command being run by the process. Normally I know what database is using the resources but not the actual query being run.

Parameters to use are:

@SPID - process to show

@DBName - processes for this db only

@running - 1 for currently running processes, 0 for not running processes and null for all

@blocked - 1 for blocked processes, 0 for non-blocked processes and null for all

@eventinfo - like search on the SQL command being run


Feel free to use it...

Total article views: 4169 | Views in the last 30 days: 1
Related Articles

Blocked and Blocking process Help

Blocked and Blocking process Help


Blocked Processes

Find Percentage of blocked processes


Locks - Blocked Processes

Where to check for blocked processes in SQL Server ??





Using the Blocked Process Report in SQL Server 2005/2008

When excessive blocking occurs in SQL, performance degrades. Learn how to use the Blocked Process R...