Link to home
Start Free TrialLog in
Avatar of saratcm
saratcmFlag for India

asked on

How to track which users logged in to sql server

Hi All,
How to track which users logged in to sql server?
do they need to have only windows login to track them or sql logins to will work to track them?
Avatar of avalenzuela
avalenzuela
Flag of Mexico image

use
   select * from sys.sysprocesses

it will list all process and what users are connected
ASKER CERTIFIED SOLUTION
Avatar of avalenzuela
avalenzuela
Flag of Mexico image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of saratcm

ASKER

Thanks for the comments, will this give information only for the users who r currently logged in or also for  currently logged off of or users no longer in that session( disconnected)?
I mean in case if I want to find out which user logged in in last 30 min or so and they might have closed their session by the time I am executing this cmd
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I would use SQL Profiler and build traces that would track audit login and logoff events.

There is a great topic on this at http://msdn.microsoft.com/en-us/library/aa905160(SQL.80).aspx
Avatar of saratcm

ASKER

Thanks