CDC – AumTechHub.Com http://aumtechhub.com Just share it!!! Tue, 23 Nov 2021 01:47:38 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.2 179596041 How to tell when data changed in a table? http://aumtechhub.com/how-to-tell-when-data-changed-in-a-table/?utm_source=rss&utm_medium=rss&utm_campaign=how-to-tell-when-data-changed-in-a-table Tue, 25 Aug 2020 00:30:17 +0000 http://aumtechhub.com/?p=10 This query will show list of each table when it was last scanned

SELECT
OBJECT_NAME(OBJECT_ID) AS TableName
,[database_id]
,[object_id]
,[index_id]
,[user_seeks]
,[user_scans]
,[user_lookups]
,[user_updates]
,[last_user_seek]
,[last_user_scan]
,[last_user_lookup]
,[last_user_update]
,[system_seeks]
,[system_scans]
,[system_lookups]
,[system_updates]
,[last_system_seek]
,[last_system_scan]
,[last_system_lookup]
,[last_system_update]
FROM sys.dm_db_index_usage_stats
WHERE database_id = DB_ID( 'NameOfDatabase')​

Note: Replace the ‘NameOfDatabase‘ with the name of your database. Also be sure run the query in the context of the same database.

]]>
10