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

  • 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

  • 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.

  • 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 😉

    "I cant 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."

    -- Itzik Ben-Gan 2001

  • 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

  • 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[/url]

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply