数据分析,需要获取数据每一张表的最后访问,修改,更新,扫描时间等:
select [table name] = [name],[create date] = create_date,[modify date] = modify_date,[last user update] = last_user_update,[last user scan] = last_user_scan from sys.tables as t inner join (select [tablename] = object_name(object_id),last_user_update, last_user_scan from sys.dm_db_index_usage_stats where database_id = db_id('test')) as sd on (t.[name] = sd.[tablename]) go