Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

What is the difference between sp_who2 and sp_whoisactive which one is better Expand / Collapse
Author
Message
Posted Tuesday, September 10, 2013 6:59 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Today @ 8:14 PM
Points: 577, Visits: 1,231
Hi all,
What is the difference between sp_who2 and sp_whoisactive which one is better
i have found a script for sp_whoisactive
and i executed the script and it created a stored procedure
and while iam comparing sp_who2 and sp_whoisactive i am unable to deside among this two storedprocedures



Thanks
Naga.Rohitkumar
Post #1493151
Posted Tuesday, September 10, 2013 7:38 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:42 PM
Points: 10,193, Visits: 13,120
Well, sp_who2 is shipped by MS with SQL Server and gives a consistent set of data and will be available on all SQL Servers. sp_whoisactive is a great tool provided to the community by Adam Machanic that has to be "installed" on SQL Servers so you may not have it everywhere. sp_whoisactive gives much more information and is much more powerful than sp_who2 as a troubleshooting tool. If I have my choice I use sp_whoisactive.



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #1493188
Posted Tuesday, September 10, 2013 4:15 PM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Today @ 6:32 AM
Points: 581, Visits: 2,712
Ditto what Jack said.

I always install sp_whoisactive and could not live without it (I run version 11.something). The most notable advantage over sp_who or sp_who2 is that you can see the active query that's running instead of the ambiguous "SELECT".

It is worth noting that they are similar but different animals. sp_whoisactive tells you about stuff running right now (which is why it's not named, sp_whoisSuspendedOrRunnableOrSleeping). My personal preference is to run them both like so:




P.S. sp_askbrent by Brent Ozar will be out soon. It's a fabulous troubleshooting tool. He's still developing it but I had a chance to play around with what he's done so far. Keep an eye out for that!

Edit: included a better pic ;)


-- Alan Burstein



Read this article for best practices on asking questions.
Need to split a string? Try this (Jeff Moden)
Need a pattern-based string spitter? Try this (Dwain Camps)
My blog
Post #1493389
Posted Wednesday, September 11, 2013 6:40 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Today @ 8:14 PM
Points: 577, Visits: 1,231
yes i too agree with you
before posting this post i have done some testing in my local pc with the stored-procedure sp_whoisactive

even i have shown keen interest in this
iam a junior sqldba in my free time i use to read blogs and if i found any use full related to sqlserve i used to learn and work in local pc or in my lap top by this iam gaining knowledge and this site only made me to stood strong technically from the time i started my Carrier as sqlserer dba

well thnks for ur elaborated reply to understand better among these two storedprocedures


Thanks
Naga.Rohitkumar
Post #1493632
Posted Wednesday, September 11, 2013 3:56 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: 2 days ago @ 7:07 AM
Points: 803, Visits: 720
While you are at it, you may also be interested in beta_lockinfo. Or may be you are not. But since I wrote it, I had to plug it. :--) The one thing I don't like with sp_whoisactive is that it has too many parameters. Hey, beta_lockinfo only has four parameters or whatever it is - and I find that I don't even know them myself.

http://www.sommarskog.se/sqlutil/beta_lockinfo.html


Erland Sommarskog, SQL Server MVP, www.sommarskog.se
Post #1493933
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse