January 3, 2010 at 11:12 pm
Hi,
I want to know the date and time of each (or specific) databases which are being used last time.
Any help would be appreciated.
Thank you,
Venu Babu
January 4, 2010 at 12:37 am
Hi,
Aron Bertrang may have something you may be interested in on his sql blog http://sqlblog.com/blogs/aaron_bertrand/archive/2008/05/06/when-was-my-database-table-last-accessed.aspx
January 4, 2010 at 2:31 am
Thank you very much for your quick turn around...
In the same way can we know which user has accessed last time along with date and time?
January 5, 2010 at 1:01 am
For such scenario is the best choice the SQL Server Auditing, but this is available only in SQL server 2008. (you can see description here http://msdn.microsoft.com/en-us/library/cc280386.aspx
For SQL server 2005 or earlier I suggest write your own auditing. You can use triggers for the audits. Unfortunately, there are no select triggers, thus if you want to log also selects then the only way is to deny direct access to the tables and views and use stored procedures for all the operations. Inside the stored procedures you can implement event logging of the selects.
Other solution could be using the SQL Trace and setup audition of object access. See more on http://msdn.microsoft.com/en-us/library/ms191006.aspx
January 5, 2010 at 2:23 am
Thank you very much for the information.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply