Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Do I need a PK?
Message
De
05/04/2001 07:07:10
 
 
À
03/04/2001 10:36:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00491302
Message ID:
00492265
Vues:
17
>I suggested we have a PK of it's own because it doens't have one, but my Analyst said we don't need one because it doesn't have any child tables.

PKs are used for alot more than that. Say you want to remember the record number the user was last browsing. If the table is packed between his sessions, storing the record number won't work because may have changed, you need another way to find out what record he was on. Or how about identifying between classes what record to process. If both of your code snippets are using cursors, you can safely pass the PK from object to object and the correct record will be used on both sides. Lots of stuff like that...

Like Erik said, it doesn't matter how its derived, jst as long as you got one and its unique.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform