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.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Find History for audit

Author  Topic 

niranjankumark
Posting Yak Master

164 Posts

Posted - 2008-11-04 : 03:20:47
User who access Currently in database can be list out by SP_WHO2 ... But daily my database need to make a log who accessed the database AND how long they accessed. i need to give this report for every month.

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-11-04 : 08:46:15
you can create Event Notification for AUDIT_LOGIN and AUDIT_LOGOUT events. after the notification fires you save it into a table. this way you get the data for your report
look here:

CREATE EVENT NOTIFICATION - http://msdn.microsoft.com/en-us/library/ms189453.aspx
Trace Events for Use with Event Notifications - http://msdn.microsoft.com/en-us/library/ms190655.aspx

_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.1 out!
Go to Top of Page
   

- Advertisement -