SQL Server with Mr. Denny

Oct 24 2007   5:09AM GMT

Upgrade for sp_who2 called sp_who3



Posted by: mrdenny
SQL, DataManagement, T/SQL, sp_who3

I’ve published this before over on tek-tips.com, but I figured that I’d republish it here as well.  I’ve written an update for sp_who2 which I call sp_who3.  It can be most useful when trying to diagnose slow running queries as it can provide a wealth of information in a single screen.

Usage:
exec sp_who3
exec sp_who3 active
exec sp_who3 blocked
exec sp_who3 72 /*Any active spid*/

Download: SQL 7 / SQL 2000 / SQL 2005

When using no parameter the output will match the output of sp_who2.

When using the “active” keyword the output will match the output of sp_who2 active.

When using the “blocked” keyword the output will have the same columns as sp_who3 active but show only the blocking and blocked processes.

This procedure has been used at companies like IGN / GameSpy, MySpace, Awareness Technologies, and Triad Financial to name a few.

Comment on this Post


You must be logged-in to post a comment. Log-in/Register

My ERRORLOG shows some spids have an ’s’ after them. What’s going on? - SQL Server with Mr. Denny  |   Apr 24 2008   12:28PM GMT

[...] When I look in the log I see that SPID 118s is the offending SPID.  When I watch SPID 118 using sp_who3 I see that the output looks a little strange.  I see a lot of CPU and disk load and that the [...]


 

Mrdenny  |   Sep 9 2008   10:05AM GMT

I’ve corrected the download links above.


 

view part of a query thats running ? | keyongtech  |   Jan 18 2009   5:16PM GMT

[...] including the current command within the batch which is being run. More info can be found here <a href="http://itknowledgeexchange.techtarge...alled-sp_who3/" title="http://itknowledgeexchange.techtarge...alled-sp_who3/" target="_blank">http://itknowledgeexchange.techtarge…a…</a> Denny On Thu, 17 Jul 2008 16:20:00 +0100, "Scott" <scott_lotus> wrote: >If i [...]