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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Confusion in Database Design

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-05-10 : 12:29:42
Gaurav writes "suppose we have three tables(tbl_color, tbl_itemmaster, tbl_bill). tbl_color contains column color_id, color. tbl_itemmaster contains item_id, itemname, color_id. tbl_bill contains bill_id, cost, item_id. tbl_color has one record (1, RED). tbl_itemmaster contains one record (1, FLOWER, 1). suppose a customer comes and bought a red flower so our tbl_bill contains now one record (1, 10.00 ,1). Now suppose by mistake we update tbl_color and changes color name RED to BLUE. Then our customer comes back and asked us to change the flower, we check the bill and now found that it states customer bought BLUE coloured flowers and customer bring back RED coloured flowers, so here comes our error. So what to do in case.
Please help me as soon.

I ask this question before also but the answer i get does not clearify me. Please help.
Thank in Advance"

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-05-10 : 13:24:42
You don't allow updates to tblColor. If you need to add values, do so. Have an active flag and/or date(range) to specify which colors are active. You then have the ability to go back historically. If you have already made this mistake, you need to go back, redo the table, and remap your data from the time this mistake was made.

I'm sure other people will have different ideas/views on this.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page
   

- Advertisement -