Click here to Skip to main content
16,008,750 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two tables; Table1 with 15 fields Table2 with 6 fields. Among these 6 fields 5 fields will share same data as in Table1. Which means If Table1 is updated I have to update Table2 as well, apart from this Table2 will have its own data as well.

My question is should I get rid of Table2 & add one extra field to Table1, in this case the remaining 9 fields will have null values for the data that was going into Table2 before.

Or I keep Table2; but in that case I will have to programmatically maintain both tables, which will cause data duplication. It is very important that the data of these two tables always match as it is the heart of the program.

Thanks in Advance.
Posted
Updated 16-Sep-12 2:01am
v3

1 solution

I recommend third solution. Create third table which will be contain 5 fields common to previous table and some Id field. In this case you will kept in table1 and table2 only reference by id to needed data.

Share data always should be kept in one place.
 
Share this answer
 
Comments
divyang_dv 16-Sep-12 12:26pm    
Thanks grzelix25, I am feeling so dumb now as I didn't thought of this solution... :) I'll start accordingly.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900