Post by Rick CharnesSP_WHO2 "mylogin"
returns *all* logins What am I missing?
It's not you, it's them! :-)
Sorry about the delay. The official answer is that it is a known bug and
will not be fixed. (If you'd like to contact support about the issue and
appeal the decision or get more information, please reference bug #402871.)
In the meantime, my advice is two write your own version of sp_who2 if this
functionality is important to you. You can do this by issuing the
following:
USE master;
GO
EXEC sp_helptext sp_who2;
Now you have a create procedure script that you can modify (including
changing the name, of course) and
If you are targeting SQL Server 2005, I strongly suggest avoiding
sysprocesses. As BOL 2005 states:
"This Microsoft SQL Server 2000 system table is included as a view for
backward compatibility. We recommend that you use the SQL Server 2005 system
views instead."
[
From the topic sys.sysprocesses
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/60a36d36-54b3-4bd6-9cac-702205a21b16.htm
]
Since this was brought up in a private conversation with Microsoft people
involved, a sort of challenge was raised, and I have created a couple of
versions for public consumption here:
http://www.aaronbertrand.com/rant.asp?r=491
Note that I replicated sp_who2 as closely as possible, using the DMVs
instead of sys* tables, and without fixing the expected @loginame behavior.
But it would be trivial to do so, and maybe I will tackle it before the week
is out. I suppose I should also complete the cycle by creating a "fixed"
sp_who2 for SQL Server 2000, and adding the @loginame filtering to ab_who2
for SQL Server 2005. But I do have more pressing items on my plate at the
moment.
A