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)
Thank this author by sharing:
By Sean Smith,
Over the years (and various versions of SQL Server) I have always had a need for different bits of information from the system tables to view activity on a SQL instance. The Microsoft "sp_who / sp_who2" procedures have always provided good information, but never really everything that I needed (and, more importantly, how I needed it... hence the reason for building my own version).
It can be run as is (example: EXECUTE dbo.usp_who5) or with optional input filter parameters:
A - Active sessions only (includes sleeping SPIDs with open transactions)
B - Blocked sessions only
S - Exclude sleeping SPIDs with open transactions
X - Exclude system processes
When using the procedure you will notice that the query output contains a lot of handy information:
If you ever need to remember what the input parameters / output columns are and what they mean, you can simply execute the following:
EXECUTE dbo.usp_who5 N'?'
Best of all, if there is any blocking occurring on the server it will come right to the top of the result set and show you the details immediately.
Any friendly feedback is always welcome. Enjoy!
This article describes a utility that allows you to identify what SQL statements are currently execu...
This is a great little feature in SQL Prompt that I wrote about at SQLServerCentral. It’s Current st...
discuss support for asynchronous batch execution in sql server 2000
In this level, Hugo explains what batch mode execution is, how it differs from row mode execution, a...
This article analyzes the performance gains of batching multiple DML statements into a single transa...