Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2009

    Unanswered: Retrieving only columns that have been updated.

    I'm looking for a way to return only the columns that have been updated from an UPDATE statement. The columns that are excluded are columns that are trying to be updated but have the same value already and therefor aren't updated.

    Are there any functions or anything that can help me out with this?

  2. #2
    Join Date
    Jun 2004
    Arizona, USA
    Take a look at triggers, specifically row level after update triggers. Add an audit table to hold the field name and timestamp. The trigger would update the audit table with the columns and timestamp values. Note that the trigger can access both the old data and new data for the row, so, you would iterate through the fields, and if the values are different, update the audit table.
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts