SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


What is the difference between sp_who2 and sp_whoisactive which one is better


What is the difference between sp_who2 and sp_whoisactive which one is better

Author
Message
naga.rohitkumar
naga.rohitkumar
SSC Eights!
SSC Eights! (852 reputation)SSC Eights! (852 reputation)SSC Eights! (852 reputation)SSC Eights! (852 reputation)SSC Eights! (852 reputation)SSC Eights! (852 reputation)SSC Eights! (852 reputation)SSC Eights! (852 reputation)

Group: General Forum Members
Points: 852 Visits: 1378
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
Jack Corbett
  Jack Corbett
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18474 Visits: 14894
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
At best you can say that one job may be more secure than another, but total job security is an illusion. -- Rod at work

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
Alan.B
Alan.B
SSCertifiable
SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)

Group: General Forum Members
Points: 5152 Visits: 7720
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 Wink

-- Alan Burstein



Best practices for getting help on SQLServerCentral
Need to split a string? Try DelimitedSplit8K or DelimitedSplit8K_LEAD (SQL 2012+)
Need a pattern-based splitter? Try PatternSplitCM
Need to remove or replace those unwanted characters? Try PatExclude8K and PatReplace8K.

"I can't stress enough the importance of switching from a 'sequential files' mindset to 'set-based' thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code. " -- Itzek Ben-Gan 2001
naga.rohitkumar
naga.rohitkumar
SSC Eights!
SSC Eights! (852 reputation)SSC Eights! (852 reputation)SSC Eights! (852 reputation)SSC Eights! (852 reputation)SSC Eights! (852 reputation)SSC Eights! (852 reputation)SSC Eights! (852 reputation)SSC Eights! (852 reputation)

Group: General Forum Members
Points: 852 Visits: 1378
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
Erland Sommarskog
Erland Sommarskog
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2113 Visits: 872
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search