SQL Server 2000/5 - Script to get list of Active or Inactive databases (except system ones) -


I need help to script all the databases on a SQL 2005 server and possibly see their activity (especially the last activity date)

The best way to do this is to run a very light profiler trace on your server and only Log the "Audit Login" event. Keep it running for one week / month / and take a look at whatever your trace log is, to see what database is currently being used. If you run a query, you can only Current will see the database used, it has not been used in the last week / month.


Comments