Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Primary Key question
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00307005
Message ID:
00307006
Views:
27
Hi Paul,

>For each invoice there are multiple line item records. What I am curious about is whether I should put the invoice pk or the invoice# in the sold line item table and also if I should put the customer pk or the customer acctno field into the invoice table.

You should go with the PK's, why? That's the reason there in the table in the first place, to give you the relation! I imagine that the Customer Accound Number is editable? Then do you expect to keep changing it in two places when they change it in one? I don't think so, thats what the surrogate PK is for, a number that doens't mean anything and the users can't see.

Or, is this one of those things that, if you save the Account No. in the invoice table, and after that the Account No. is changed, but you want the invoice to still reflect the Account No. as it was when it was created? Then I suggest putting both (the Account PK and No.) fields in the invoice table.
Previous
Reply
Map
View

Click here to load this message in the networking platform