Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
buzby
Starting Member
1 Post |
Posted - 2014-07-16 : 09:43:50
|
I have an application audit table (e.g. audit_log) which records the following information : user_id row_creation action20039 2014-05-15 13:09:20.000 2020048 2014-05-15 13:15:22.550 2020039 2014-05-15 13:30:33.540 2120048 2014-05-15 15:44:14.747 2120048 2014-05-16 08:10:27.523 2020048 2014-05-16 08:39:21.187 2120048 2014-05-19 08:22:54.920 2020048 2014-05-19 08:24:06.597 2120048 2014-05-19 09:42:34.907 2020048 2014-05-19 10:23:19.090 21where action is defined :20 = login21 = logoutHow can I query the table for following management information (in SQL SERVER 2008)?1. Last user login?2. How long(i.e. duration) user has been online for the day?3. How many times user has login or logout per day?4. which users logged into system on certain day? 5. Which users still logged in after 11pm?6. Any other statistic that could be useful to management?Any help would be much appreciated.kind regards,Buzby |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-07-16 : 12:25:08
|
http://www.sqlservercentral.com/articles/Best+Practices/61537/Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
|
|
|