1SELECT d.name,
2last_user_seek = MAX(last_user_seek),
3last_user_scan = MAX(last_user_scan),
4last_user_lookup = MAX(last_user_lookup),
5last_user_update = MAX(last_user_update)
6FROM sys.dm_db_index_usage_stats AS i
7JOIN sys.databases AS d ON i.database_id=d.database_id
8GROUP BY d.name
9