Results 1 to 6 of 6

Thread: Data Change

  1. #1
    Join Date
    Dec 2004
    Posts
    7

    Unanswered: Data Change

    Can anybody suggest the best way I can achieve the following.

    To select anybody whose surname has change in the last week, and to automatically flag a code field with "C".

  2. #2
    Join Date
    Nov 2003
    Location
    London
    Posts
    169
    Hi,

    Does your table have date field which is updated everytime a user updates the table?

  3. #3
    Join Date
    Dec 2004
    Posts
    7

    Modification Date

    Yes I have found that it has a Modifcation Date field.

  4. #4
    Join Date
    Nov 2003
    Location
    London
    Posts
    169
    Is there anyway to tell whether it is the surname that has been updated? Or could it be another field?

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Are you looking for a general solution, or is this a one-time issue?

    For a general solution, you should use a trigger to stamp a datefield anytime a surname is modified.

    For a one-time solution, restore a backup of your table from a week ago under a different name, and then join them on their primary keys to compare surnames.

    .....you do have weekly backups, right?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  6. #6
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    if you have no record of this information,(the prior updating of the surname) you will need to create a audit column or and audit table then you can create a trigger that will indicate as such from here on out.

    here are some {books online} articles you might want to look at.

    Create Trigger
    Alter Trigger
    Programming Triggers

Posting Permissions

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