If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > How to design changing data fields?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-15-09, 12:17
haris77 haris77 is offline
Registered User
 
Join Date: Apr 2009
Posts: 8
How to design changing data fields?

Friends,

Please help me to undestand the best design to tackle this recurring problem.
I have a EMPLOYEE_MASTER table with the following structure. EMP_DESIGNATION may change over time. I want to keep the history of such changes for future references. What is the most efficient approach to store designation here? Should I move it to another table with an effective start date and end date?

EMPLOYEE_MASTER(EMPID,EMPNAME,EMP_DESIGNATION)

Thanks,
Harish.
Reply With Quote
  #2 (permalink)  
Old 04-15-09, 14:59
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
Quote:
Originally Posted by haris77
Should I move it to another table with an effective start date and end date?
Spot on.
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #3 (permalink)  
Old 04-15-09, 16:41
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
Run this code with your table name as the parameter,
and it will generate a script for creating an archive table, along with the triggers necessary to maintain it. It will record every change to the data in your table.
sqlblindman private pastebin - collaborative debugging tool
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On