Re: [Q] Most logical way to keep history ?

From: Harald Schmidt <Harald.Schmidt_at_tomcat.de>
Date: 2000/07/28
Message-ID: <B5A7B4E8.76EA%Harald.Schmidt_at_tomcat.de>#1/1


in article 8lrq66$h1p$1_at_news1.xs4all.nl, Jerold at dlareg_spamfilter__at_cryogen.com wrote on 28.07.2000 13:18 Uhr:

> Hi,
>
> What is the most logical solution, or 'best' solution according to
> database-theory to keep the history of an object (row) in a table.
>
> ie:
> Employee Table
> Fields: id, Name, Adress, Age
>
> If one changes the Name the old information should be stored somewhere in
> the database so that the change can be looked up.
> (so a history of changes to a certain employee is built up)
>
> Should I make a separate table called 'old employee'. Or use a parent-child
> kind of relation ship within the Employee Table like:
> Employee: id, Name, Adress, Age, Parent. where "parent" points to its
> (newer) parent. ?
>
> Thanks!
>
> Jerold.
>
>
...a quick solution could be the extension of the table by a timestamp field. Then if you want to get a specific employee, sort it by the timestamp field desc. Then you've always the change history of a specific employee. But a separate table with the timestamp field extension and a foreign key would would bring more performance.

Harald Received on Fri Jul 28 2000 - 00:00:00 CEST

Original text of this message