As a DBA , I had to determine if a large number of Databases were actually being used. I wrote this script to create triggers that write to an audit table if any table in the Database was updated.
It first creates an audit table to write to whenever any table is updated.
It then loops thru each table and generates an Insert,Update and Delete trigger for each table.
Whenever a row in any table is updated,inserted, or deleted it inserts a row to the audit table with the date of the update.
It will only log the update once, since the purpose of this was to determine if the Database was being used.
I checked the audit table after about 3 months, and removed any Databases that showed no update activity.
Of course if the Database is not being updated, this will not work. However most tables in a Database will eventually be updated, then the trigger will capture the date of the update.