Find last time column was updated

  • Hi

    I have a tbl with lots of columns, many are not being used.

    Is it possible to find from stats when the column was last updated. I've put a timestamp on but this gets updated for all columns and I'm using it to tell if a record has changed.

    However I know the code only updates a field if it has changed. So many will not have been updated.

    Is there a query I can use

  • Depending on the version of SQL Server you are using, there are a number of options (after the fact):

    http://msdn.microsoft.com/en-us/library/cc280386.aspx

    You may also want to consider Change Data Capture, or using triggers on the tables you wish to monitor.

    _____________________________________________________________________
    Disclaimer - The opinions expressed by the mouth are not necessarily those of the brain

  • Hi,

    This can be achieved using Change data capture in sql server 2008.

    http://msdn.microsoft.com/en-us/library/bb500243.aspx

  • Thank you v.much

    Got the audit set up and running not the format I wanted will try the capture event. As usual something has come up so will have to drop this for now.

    But will look into this capture - seems teh ticket

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply