• virtualjosh (5/23/2011)


    I use system tables to see if the table has been updated:

    SELECT @expiration_dt = [modify_date]

    FROM [mydb].[sys].[tables]

    WHERE [name] = 'mytable'

    If I detect @expiration_dt to be newer than my stored data (which obviously is datetime'd), then I rerun my code.

    The modified_date column on the sys.tables or sys.objects catalog views contains the date/time the schema for an object was last altered. For example, if you add a new column. It doesn't contain the date/time of the last insert/update/delete.

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