Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Primary Index Key on multiple fields.
Message
De
19/04/2002 13:11:24
 
 
À
19/04/2002 09:55:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00646879
Message ID:
00646978
Vues:
18
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform