• SQL Server maintains statistics, which includes counts and timestamps, whenever table indexes are updated. This meta data can be queried from an interesting data management view called sys.dm_db_index_usage_stats. For some situations this would suit the purpose of detecting table changes.

    For example:

    select object_name(s.object_id) as table_name, i.name as index_name,

    last_user_update, user_updates

    from sys.dm_db_index_usage_stats as s

    join sys.indexes i on i.object_id = s.object_id and i.index_id = s.index_id

    where object_name(s.object_id) = 'InvHeader';

    table_name index_name last_user_update user_updates

    ---------- ----------------- ----------------------- ------------

    InvHeader pk_invheader 2011-05-20 15:50:07.210 3713

    InvHeader uix_invheader 2011-05-19 19:15:01.370 371

    There are other columns in this view that return the number of seeks, scans, etc. so it can also be levereaged to determine how often indexes or tables are being accessed.

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho