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


DBA Tools:sp_who3


DBA Tools:sp_who3

Author
Message
Mircea
Mircea
SSC Rookie
SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)

Group: General Forum Members
Points: 47 Visits: 353
Comments posted to this topic are about the item DBA Tools: sp_who3

Hi All,

Just a note to let you know that the issue with the TAB characters has been resolved, so you can just copy and paste the script if you would like to use it.


Thanks



boris_shvartsman
boris_shvartsman
SSC-Enthusiastic
SSC-Enthusiastic (192 reputation)SSC-Enthusiastic (192 reputation)SSC-Enthusiastic (192 reputation)SSC-Enthusiastic (192 reputation)SSC-Enthusiastic (192 reputation)SSC-Enthusiastic (192 reputation)SSC-Enthusiastic (192 reputation)SSC-Enthusiastic (192 reputation)

Group: General Forum Members
Points: 192 Visits: 200
can't compile this proc on SQL Server 2005 SP2, x64

get error:

Msg 102, Level 15, State 1, Procedure sp_who3, Line 49
Incorrect syntax near ' '.
Msg 102, Level 15, State 1, Procedure sp_who3, Line 103
Incorrect syntax near ' '.
Msg 102, Level 15, State 1, Procedure sp_who3, Line 105
Incorrect syntax near ' '.
Msg 102, Level 15, State 1, Procedure sp_who3, Line 117
Incorrect syntax near ' '.
Msg 102, Level 15, State 1, Procedure sp_who3, Line 229
Incorrect syntax near ' '.

if one wants it.. one will justify it.
Mircea
Mircea
SSC Rookie
SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)

Group: General Forum Members
Points: 47 Visits: 353
Hi,

It appears that the TAB character was replaced by a series of 4 question marks (????) in the script I submitted.
I will contact SQL Server Central and this will be corrected shortly.

Thank you



Dugi
Dugi
SSCertifiable
SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)

Group: General Forum Members
Points: 7840 Visits: 3511
Works nice in SQL Server 2008 x64!

It would be better if you add the IP info!

Thanks for sharing Cool

============================================================
SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
http://www.sqlservercentral.com/articles/Best+Practices/61537/
ken.trock
ken.trock
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2152 Visits: 1735
I can get it to compile on SQL 2005 and 2008 on a couple IA64's and it runs ok using the DB param. If there's no DB matching the name it shows all processes. The Login name is a different story. I can get "<login> is not a valid login or you do not have permission." even when I'm looking for a legitimate login.

Thanks,
Ken
Mircea
Mircea
SSC Rookie
SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)

Group: General Forum Members
Points: 47 Visits: 353
Hi,

Thank you for using the script and posting the comments. Could you please use the same login parameter in sp_who2 and compare the output ?
You should get the same results as the ones you get in sp_who3.

The main use for sp_who3 resides in it's ability to display all users for a certain database or set of databases.

Thanks



ken.trock
ken.trock
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2152 Visits: 1735
Yes, your sp_who3 returns the same info as sp_who2 using the login param. I see. You retained existing code for this param while adding your own for the DB param.

Ken
Mircea
Mircea
SSC Rookie
SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)

Group: General Forum Members
Points: 47 Visits: 353
Hi,

Thank you very much for your comments and your suggestion.

The stored procedure returns the HostName.

Although it would be a simple exercise to get the IP address for the given HostName, it is beyond the scope of this stored procedure. I intended for the output to be in a familiar form for the DBA, as returned by sp_who2.

The main use for this stored procedure is as a very fast tool to get the top processes using I/O resources.

Thanks,
Mircea



SQLRNNR
SQLRNNR
SSC Guru
SSC Guru (111K reputation)SSC Guru (111K reputation)SSC Guru (111K reputation)SSC Guru (111K reputation)SSC Guru (111K reputation)SSC Guru (111K reputation)SSC Guru (111K reputation)SSC Guru (111K reputation)

Group: General Forum Members
Points: 111246 Visits: 18624
Nice script.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw

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