Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Primary Key generation
Message
De
24/04/2013 19:44:22
 
 
À
24/04/2013 19:00:54
Naeem Afzal
Syed Junaid Alam
Manama, Bahrain
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
01571831
Message ID:
01571834
Vues:
66
J'aime (1)
PK should be system generated and used only by the system to enforce referential integrity. So, use identity column. In most cases, it is invisible to the user. You can still have your field and make it an alternate key. Just index on it.

>Hello,
>
>I want to use MS sql database for my vfp program. In vfp I use a table with fields to generate primary keys for various tables. I lock the field and increment it and then format it according to my requirement like "Vno-00001".
>
>How can I do this in sql table from vfp? Should I use
>
>1) a stored procedure to generate the PK with Transaction Islolation
>
>2) An Insert statement with any explicit lock hints.
>
>I know that the best option is to use Identity column as searched on web. But I need to generate a PK or an Alternate key to identify my record with some serial numbers that based on month or year.
>
>TIA
>Naeem
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform