July 21, 2008 at 11:11 am
I have 2 tables.
tblParts
columns: PartID, PartNum, PartPrice
tblPricing
Columns: PricingID, PartID, PartPrice1
When tblParts.PartPrice is updated or inserted i want to insert the new price and the PartID into tblpricing accordingly.
What would be the best way to accomplish this?
July 21, 2008 at 2:10 pm
To have someone guide you to the proper answer, it would help if you posted your question in a meaningful format Please follow the link in my signature and repost the question.
July 21, 2008 at 2:31 pm
You have a few options. One is a trigger, another is the update proc, another is the front-end code.
The easiest and most consistent is probably a trigger, but that does have a few drawbacks (mainly that triggers are pretty much invisible if you forget them, and can be a pain later in that case).
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
July 21, 2008 at 6:09 pm
I just don't see a need for the pricing table... all of the required information is in the parts table. There is no need to have duplicate information in the database.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 22, 2008 at 5:35 am
Thank you for your responses!
I am using this data for 2 things.
1 is historical tracking of the price and also data auditing.
You have answered my questions Thanks!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply