Reputation: 61
How to get the list of all tables modified in the last N days?
Upvotes: 1
Views: 2836
Reputation: 3793
you can refer to this answer too :
http://blog.sqlauthority.com/2009/05/09/sql-server-find-last-date-time-updated-for-any-table/
Upvotes: 0
Reputation: 43499
If this is for data, you can use a query like:
exec sp_MSforeachtable 'SELECT OBJECT_NAME(OBJECT_ID) AS DatabaseName, last_user_update,*
FROM sys.dm_db_index_usage_stats
WHERE database_id = DB_ID(''<yourDataBaseNameHere>'')
AND OBJECT_ID=OBJECT_ID(''?'')'
and filter the result for the date range you are interested in. See latt_user_updates column.
Upvotes: 3