I have a number of old databases and I am not sure if they are still in use. How can I determine the last time that a database had a query run in it?
asked Oct 29, 2009 at 12:32 PM in Default
Steve Jones - Editor ♦♦
I decided to make it a scalar function. This checks all index (including heap) usage statistics and all object modification times.
Now just call the function for any database name.
answered Oct 29, 2009 at 01:12 PM
I have migrated an old database to SQL server 2008 and no one knows if every object in the database is in use anymore. I activated database audit to log "object access" and use the "audit file" to update "last accessed" column in a table with all user objects. If the object has not been used for a long time we rename it in our acceptance test server.
Read more about auditing in http://msdn.microsoft.com/en-us/library/dd392015.aspx
answered Oct 29, 2009 at 02:37 PM