This script is relevant to our 3 tier distributed infrastructure, but should
get you started.
SET NOCOUNT ON
select cast(hostname as char(16)) 'HOSTNAME',
cast(loginame as char(20)) 'LOGIN',
count(hostname) 'active count'
from sysprocesses
where upper(cmd) <> 'AWAITING COMMAND'
group by hostname, loginame
order by hostname, loginame
Rick
> -----Original Message-----
> From: The Oracle Man [SMTP:[Email Address Removed] Sent: Wednesday, July 10, 2002 12:11 PM
> To: [Email Address Removed] Subject: Who is logged in?
>
> Hi all. I'm running MSSQL 2000 and wonder how I find
> out who is logged into the database at a given time
> and get a count of the currently active connections. I
> looked thru the documentation and didn't find what
> table this information is kept in or how to find this
> out. If anyone has a script that would be good OR if
> you can just tell me where to find the information I
> can write the script. Maybe there is a stored
> procedure???
>
> Thanks in advance for any help and
> hope you have a good day/night.
>
> Keith
>
> __________________________________________________
> Do You Yahoo!?
> Sign up for SBC Yahoo! Dial - First Month Free
> http://sbc.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: mssqldba-[Email Address Removed] For additional commands, e-mail: mssqldba-[Email Address Removed]MS Sql Server LazyDBA home page