Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Primary key
Message
De
05/06/2001 08:58:58
 
 
À
04/06/2001 07:13:38
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Divers
Thread ID:
00514475
Message ID:
00515046
Vues:
16
A table usually has a column or combination of columns whose values uniquely identify each row in the table. This column (or columns) is called the primary key of the table and enforces the entity integrity of the table. A table can have only one PRIMARY KEY constraint, and no column that participates in the PRIMARY KEY constraint can accept null values.
You can use UNIQUE constraints to ensure that no duplicate values are entered in specific columns that do not participate in a primary key. While both a UNIQUE constraint and a primary key enforce uniqueness, use a UNIQUE constraint instead of a PRIMARY KEY constraint when you want to enforce the uniqueness of:
 A column, or combination of columns, that is not the primary key.
Multiple UNIQUE constraints can be defined on a table, whereas only one PRIMARY KEY constraint can be defined on a table.
 A column that allows null values.
UNIQUE constraints can be defined on columns that allow null values, whereas PRIMARY KEY constraints can be defined only on columns that do not allow null values.
A UNIQUE constraint can also be referenced by a FOREIGN KEY constraint.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform