I have a query I am using
SELECT OBJECT_NAME(OBJECT_ID) AS TableName, last_user_update
WHERE database_id = DB_ID( 'databasename')
AND last_user_update >= '2011-02-14 14:54:00'
order by last_user_update asc
I have about 200 databases and im trying to find out which ones are actively being used.
first of all, please confirm that the last_user_update field is wiped clean during a sql server restart.... does this refer to total server reboot or just when the instance is restarted.
also, tough question, but is there a way to automate this for every database and to have it populate a an excel spreadsheet when I run it. that way I will keep track between reboots...
I would like the data to contain
database name and the first result of the above query. and have it run once a week. and populate a txt or csv file
I know almost an impossible question. if someone has a better way to figure out my problem... please advise
Thanks a bunch