Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
SergioM
Posting Yak Master
170 Posts |
Posted - 2014-11-02 : 23:37:58
|
Lets say that I'm keeping track of changes over time. I would want to have a field for the date when the row was added. Then rather than delete or update the data, I would age out the old row by adding a date to the DateExpired field and insert a new row where date expired is NULL.This does the job, but it looks like it violates the third normal form by creating duplicate data. The only thing that makes me think otherwise is that SSIS' slowly changing dimension does it this way. Alternatively I could leave all of the non-pertinent fields as NULL and only store the actual changes. Though the querying would become much more complicated & I'm not even sure if it's technically correct.Does anyone have thoughts on this?ID UserID First Last Password DateAdded DateExpired1 26 John Doe abc 2014-10-30 10:00:00 2014-10-31 10:00:002 26 John Doe def 2014-10-31 10:00:00 2014-11-01 10:00:003 26 John Doe ghi 2014-11-01 10:00:00 NULL -SergioI use Microsoft SQL 2008 |
|
ninjadbskillznot
Starting Member
4 Posts |
|
|
|
|