Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Surrogate Primary Keys - Integer or Character ?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00397596
Message ID:
00397835
Vues:
27
>>>>I can't think of a good reason to use a character data-type for a surrogate primary key. The integer data-type seems particularly well suited for surrogate primary keys, and you can always STR it if you need to concatenate it with another field. Using the STR of a numeric value for the key itself seems like unnecessary overhead.
>>>
>>>Then, what about using GUID ? It's character type and it's BIG - 38 char long...
>>
>>Nick,
>>
>>Nope, a GUID is a 16 byte integer. From the Platform SDK - COM:
>>
>>"CoCreateGuid - Creates a GUID, a unique 128-bit integer used for CLSIDs and interface identifiers."
>
>I mean the actual value which is returned from the function posted in
>John Koziol's message
>Re: Uniqueness of Indexes - how do you handle this? Thread#376137 Message#380129

Nick,

I recall the thread. It's referring to a CLSID created from a GUID. A CLSID is a hex representation of GUID. Two characters per byte plus four hyphens plus 2 curly braces = 38.< s >
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform