Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Indexing : Best Practice.
Message
 
 
À
05/06/2003 10:32:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00796703
Message ID:
00796721
Vues:
15
>Based on your last message, how do you define your primary keys if you do not use compound indexes?
>
>Jason

All of my tables (without exception) have an integer that is used as the primary key - this is not unique across tables, but it would not take a great deal of effort to make it so. If new data is created at multiple (disconnected) locations, then I would use a GUID.

I prefer Integers, because if I need to delete a record, I just multiply the (normally) positive integer by -1 and make it negative. When I need to add a new record I first Select Top 1 iPrimaryKey From Table Where iPrimaryKey < 0 - if there are no rows returned, then I need to really create a new record and not reuse an old record. Reused records, simply have there primary key multiplied by -1 again, to return it to its original positive value.
censored.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform