Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Primary Index Key on multiple fields.
Message
From
19/04/2002 13:11:24
 
 
To
19/04/2002 09:55:48
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00646879
Message ID:
00646978
Views:
17
>As a general rule you should NEVER have primary keys on dependant data in a table, For Primary keys I always generate a URN type Field ( unique reference number) and other indexes are just Regular type not primary , candidiate or unique
>duplicate table data in a primary key will cause table updates to fail with the error uniqueness of index is violated...

Colin,

I agree with your general rule, except general rules generally :) don't have the word NEVER in them. There are exceptions, and my intent here is not to open up the surrogate key can of worms *grin*.

If I read your suggestion correctly, you are saying that his secondary index would be a regular index, not a candidate index. I don't see that solves his problem. He wants to enforce uniqueness of the po_num + line_num combination, and wishes to do that through the index. Certainly using a candidate index is a valid method of doing that.

Just my $.02,
Steve Gibson
Previous
Reply
Map
View

Click here to load this message in the networking platform