想知道数据表的用户或系统异动时间
从这个表sys.dm_db_index_usage_stats可以获取到所有表或某一张表的用户或系统异动时间:
SELECT OBJECT_NAME(object_id) AS table_name, last_user_seek, last_user_scan, last_user_lookup, last_user_update, last_system_seek, last_system_scan, last_system_lookup, last_system_update FROM sys.dm_db_index_usage_stats WHERE database_id = DB_ID('dataname') GO