從這個表sys.dm_db_index_usage_stats可以獲取到所有表或某一張表的用戶或系統異動時間: SELECT OBJECT_NAME(object_id) AS table_name, last_user_seek, last_user_scan, last_user_lookup, ...
從這個表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') GOSource Code