You can define constraints on a single column or on multiple columns. Single-column constraints are referred to as column-level constraints. You can define this type of constraint when you create the column on the table. Constraints that reference multiple columns must be defined on the table and are considered table-level constraints. Table-level constraints must be defined after all the referenced columns in the table are created.
You can create constraints with T-SQL by using the
CREATE TABLE or
ALTER TABLE statement. When you create a column-level constraint by using the
CREATE TABLE statement, the
CONSTRAINT keyword and constraint definition are included immediately after the column ...