Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Primary Key Value
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00883338
Message ID:
00883436
Vues:
11
>I can't find anywhere that anyone has done this, though I'm certain that you all have.
>
>I have a 2 character TableID.
>I have a datetime value.
>
>I would like to combine those together and somehow covert that into a unique Primary Key value 16 characters. Should I just concatenate the two?
>
>[AA]+ttoc(datetime(), 1)
>
>Will that assure uniqueness across various systems that will not be sharing a table from which they can pull the next available number?




DJ

As Craig said, that may not be the best approach. Besides AutoInc fields you can have a counter table or you can use a GUID (though they are too lonmg as keys for most of my uses :).

You can find code samples for these two at my site her:
http://feldstein.net/newid.asp


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform