add a constraint to a table in sql code example Example: add constraint sql ALTER TABLE Persons ADD CONSTRAINT PK_Person PRIMARY KEY (ID,LastName);