disasterkid
disasterkid

Reputation: 7278

An extra column that explains when a value in the same row was updated

In my database table, I have a LastUpdated column that describes when the current row was last updated.

What the customer has now asked for is to have a few more DateTime columns in the table to keep track of individual values within the same row

E.g. there's a column called Address and they would like to have an extra column AddressLastUpdated to know when it was last changed.

For some reason, this does not look like a good solution. It is certainly doable. But I am wondering if there's a better way of implementing this. Since if we have this in place for one column, chances are they are going to want to have a LastUpdated column for every column in the table.

Upvotes: 1

Views: 25

Answers (1)

Umesh Tiwari
Umesh Tiwari

Reputation: 36

Keeping a bridge table with below structure will help.

Structure :

  • Key Column of the table (e.g. Customer Key / Customer No)
  • Updated Column Name
  • Last Updated Date / DateTime

Above solution will help in 2 ways :

  1. Keep the existing table structure intact.
  2. All the future such requests can be easily managed.

Upvotes: 2

Related Questions