Monday, March 19, 2012

Last login

Hello everybody!!
Do you know how to find out the last login time for all acccounts ?
please, to instruct for me.
thank you very much. :lol:Hi,
SQL Server by default will not store the Last login time in any system
tables.
But you could go for any of the below 2 approaches to attain this:-
1. Enable the audit level for successful login and Faile Logins using
Enterprise manager ... SECURITY tab. This will put all the
successful and failed logins to sql server in sql server error log. You
could open the log and identify the last login time.
2. Write a stored procedure and read the Master..sysprocesses table every 1
minute (use SQL Agent jobs) and put it into a user defined table.
Later you could read this table to identify the last login time..
Thanks
HARI
SQL Server MVP
"william.huang" <william.huang@.saturn.yzu.edu.tw> wrote in message
news:OkGa0g6eFHA.3836@.tk2msftngp13.phx.gbl...
> Hello everybody!!
> Do you know how to find out the last login time for all acccounts ?
> please, to instruct for me.
> thank you very much. :lol:
>|||thanks
the second one did help
"Hari Prasad" <hari_prasad_k@.hotmail.com> glsD:OxxfTt7eFHA.3160@.TK2MSFTNGP09.phx.g
bl...
> Hi,
> SQL Server by default will not store the Last login time in any system
> tables.
> But you could go for any of the below 2 approaches to attain this:-
> 1. Enable the audit level for successful login and Faile Logins using
> Enterprise manager ... SECURITY tab. This will put all the
> successful and failed logins to sql server in sql server error log. You
> could open the log and identify the last login time.
> 2. Write a stored procedure and read the Master..sysprocesses table every
> 1 minute (use SQL Agent jobs) and put it into a user defined table.
> Later you could read this table to identify the last login time..
> Thanks
> HARI
> SQL Server MVP
>
>
> "william.huang" <william.huang@.saturn.yzu.edu.tw> wrote in message
> news:OkGa0g6eFHA.3836@.tk2msftngp13.phx.gbl...
>

No comments:

Post a Comment