Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL statement To Maintain History in SQL Server 2005 Expand / Collapse
Author
Message
Posted Sunday, April 4, 2010 10:56 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, April 6, 2010 5:50 AM
Points: 1, Visits: 5
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.
Post #896433
Posted Sunday, April 4, 2010 11:26 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 5:34 AM
Points: 999, Visits: 13,481
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?
Post #896437
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse