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 |
clinton_eg
Yak Posting Veteran
60 Posts |
Posted - 2012-03-14 : 09:50:32
|
TeamI had a query which i need help with. Senario: Say i create a normalized database, as per my understanding if i change the name of an analyst' s manager in the Headcount table it will:1) Change the manager name in all tables which reference the manager field in the Headcount table2) it will affect historical data also.Requirements:i am fine with point 1 but not point 2 as i don't want this to affect the historical data.Request your expert opinion's on this. How should i avoid historical data from being affected.P.S - Please suggest any book, online tutorials which will help me understand the database development concepts and best practices.ThanksEwan Gilby |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2012-03-14 : 11:08:32
|
1. No it won't. It will change the manager name in result sets of queries. If the manager name exists in other tables, then it isn't exactly normalized.2. History should NEVER be allowed to change. Historical records are often flattend out (de-normalized) for this very purpose. Also, some records should never be allowed to change. Instead, add a bit column indicating status (active/inactive), then add NEW records when certain things change. |
|
|
clinton_eg
Yak Posting Veteran
60 Posts |
Posted - 2012-03-14 : 14:00:52
|
quote: Originally posted by russell 1. No it won't. It will change the manager name in result sets of queries. If the manager name exists in other tables, then it isn't exactly normalized.2. History should NEVER be allowed to change. Historical records are often flattend out (de-normalized) for this very purpose. Also, some records should never be allowed to change. Instead, add a bit column indicating status (active/inactive), then add NEW records when certain things change.
Hi russell, regarding point 1 what i mean was i will have 2 or more views which do a join with the headcount table to retrieve the manager names.regarding point 2, could you provide me refrences to any study material which will explain your concept in detail.Ewan Gilby |
|
|
|
|
|
|
|