Re: Can I historize tables?

From: Justin Cave <jocave_at_yahoo.com>
Date: 13 Sep 2002 15:21:15 -0700
Message-ID: <233b7a65.0209131421.50b773b6_at_posting.google.com>


urswagner_at_bluemail.ch (Urs) wrote in message news:<d817deb6.0209130343.175dd83f_at_posting.google.com>...
> Hello
>
> I have always to import some code tables from another system.
>
> I would like to save the old tables content. Because sometimes I have
> to go back to the old version?
>
> What is the best way to do this?

Well, you could

  • create an "old version" table (tblOld)
  • insert into tblOld select * from tblCurrent
  • truncate table tblCurrent
  • insert into tblCurrent select * from <table on other system>

You could also add a version column to the table that indicated whether the data was old or new (this would be more flexible if you wanted to maintain multiple historical versions). You could then write views on that table that showed just the old data or just the new data. If there is a lot of data, you may want to partition the table by version.

Justin Cave Received on Sat Sep 14 2002 - 00:21:15 CEST

Original text of this message