Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sys(3) Function
Message
De
13/11/1998 15:28:42
Raymond Humphrys
Michigan Department of Community Health
Bath, Michigan, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00157162
Message ID:
00157529
Vues:
17
Just out of curiosity, I generated 40,000 numbers using SYS(3) in a loop on a 450 mhz machine (NT4.0, 96 mb ram) and I didn't get any duplicates. Strange...


>Hi Garrett,
>
>>If I understand correctly, CoCreateGuid() keys off the MAC address of the Ethernet card, if one exists, and is therefore guaranteed to be unique between machines with cards. Within a machine, I suppose you could defeat it by resetting the system clock, and running it at exactly the same time.
>
>>As I understand it, if the machine doesn't have an Ethernet card, it uses some other algorithm that is unlikely to produce duplicates.
>
>CoCreateGuid(), according to the documentation, calls UuidCreate(), which uses the Ethernet or token ring hardware address. That function can return a RPC_S_UUID_NO_ADDRESS error if it cannot get this information.
>
>>BTW, the Identity columns in SQL Server 7 are supposed to be GUIDs, so that every row is unique globally, not merely within a table.
>
>As an FYI for other readers of this thread, here's what the documentation says about CoCreateGuid():
>
>"The CoCreateGuid function calls the RPC function UuidCreate, which creates a GUID, a globally unique 128-bit integer. Use the CoCreateGuid function when you need an absolutely unique number that you will use as a persistent identifier in a distributed environment.To a very high degree of certainty, this function returns a unique value - no other invocation, on the same or any other system (networked or not), should return the same value."
>
>I think that the above explains pretty well why SQL Server 7 uses them.
>
>Regards,
Some days it's not worth chewing through the leather straps ...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform