SQL statement To Maintain History in SQL Server 2005

  • Hi

    I have a table containing details of customers. When updating this table, I want to maintain the original details, I don't want to overwrite the original data. Can I have any hints on how to do this.

  • carringtonmukwasi (4/4/2010)


    Hi

    I have a table containing details of customers. When updating this table, I want to maintain the original details, I don't want to overwrite the original data. Can I have any hints on how to do this.

    if you dont want to overwrite the data you shouldnt be using an update statement, you should be using an insert. if you want to use an update then you need to record the changes into an audit log table. this could either be done using a trigger or application logic.

    How are you planning on using this archived data?

Viewing 2 posts - 1 through 1 (of 1 total)

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