dan-cat
Registered User.
- Local time
- Today, 23:07
- Joined
- Jun 2, 2002
- Messages
- 3,433
Hi,
We all know we're not supposed to duplicate data right? So was wondering how people deal with the deletion of Master records.
For instance let's say I have 3 tables.
tblSales
tblSalesSub
tblProducts
tblSales - lists the sales summary - stuff like SaleId, SaleDate, SaleTotal
tblSalesSub - lists the products contained within the sale.
tblProducts - is the Master list of products storing the product specifics
Now to prevent duplication of data I should just store the productId in tblSalesSub then reference that to tblProducts with an innner JOIN of some kind.
But what if the Master record gets deleted? The reference is broken and NULL values are returned.
How do you deal with this?
Don't allow deletion of these records?But just hide them when deleted?
Duplicate data by storing the product title and description within tblSalesSub?
Tell the user - tough cheese you shouldn't have deleted it should you?
Any other ideas?
Dan
We all know we're not supposed to duplicate data right? So was wondering how people deal with the deletion of Master records.
For instance let's say I have 3 tables.
tblSales
tblSalesSub
tblProducts
tblSales - lists the sales summary - stuff like SaleId, SaleDate, SaleTotal
tblSalesSub - lists the products contained within the sale.
tblProducts - is the Master list of products storing the product specifics
Now to prevent duplication of data I should just store the productId in tblSalesSub then reference that to tblProducts with an innner JOIN of some kind.
But what if the Master record gets deleted? The reference is broken and NULL values are returned.
How do you deal with this?
Don't allow deletion of these records?But just hide them when deleted?
Duplicate data by storing the product title and description within tblSalesSub?
Tell the user - tough cheese you shouldn't have deleted it should you?
Any other ideas?
Dan