Mot-clé SQL ADD CONSTRAINT
AJOUTER UNE CONTRAINTE
La ADD CONSTRAINT
commande est utilisée pour créer une contrainte après la création d'une table.
Le SQL suivant ajoute une contrainte nommée "PK_Person" qui est une contrainte PRIMARY KEY sur plusieurs colonnes (ID et LastName) :
Exemple
ALTER TABLE Persons
ADD CONSTRAINT PK_Person PRIMARY KEY (ID,LastName);