SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL statement To Maintain History in SQL Server 2005


SQL statement To Maintain History in SQL Server 2005

Author
Message
carringtonmukwasi
carringtonmukwasi
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
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.
Animal Magic
Animal Magic
Hall of Fame
Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)

Group: General Forum Members
Points: 3434 Visits: 13752
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?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search