Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Primary keys
Message
De
22/11/2001 01:51:17
 
 
À
22/11/2001 01:36:02
Jimi Lee
Pop Electronic Products Ltd.
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00584816
Message ID:
00584820
Vues:
35
This message has been marked as the solution to the initial question of the thread.
>hi all,
>
>can someone show me a simple SQL statment to create a table with 2 primary keys?
>
>thanks a lot!
>Jimi

You can't create a table with two primary keys, only one per table is allowed. What you can do is create a candidate key (field with a candidate index), which functions in a similar way as a primary key. A sample statement to do that would be:
CREATE TABLE mypktest (iid i PRIMARY KEY, ssn c(10) UNIQUE)
Uniqueness is enforced on both a primary key and a candidate key. HTH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform