December 11, 2003 at 12:29 pm
Is there a way using T-SQL to get a list of active logins? What I'm looking for is something similar to what I can see in EM under Current Activity/Process Info. I am writing a script to shut down SQL Server but I want to make sure no one is connected to the server at the time.
Francis
December 11, 2003 at 12:50 pm
You can execute sp_who or sp_who2 with it is more complete.
Every time you need to imitate something EM does in T-SQL it is good to execute a trace with profiler, to know what is EM executing.
Remember that almost everything it is done with EM, it T-SQL code.
December 11, 2003 at 1:00 pm
Also you can query the sysprocesses system table to see the current processes:
select * from master..sysprocesses
December 11, 2003 at 1:25 pm
Thanks guys. I'm on track now.
Francis
December 12, 2003 at 11:29 am
Pass the 'active' as the parameter for sp_who.
sp_who 'active'
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply