Constraints are an ANSI-standard method used to enforce the integrity of the data in the database. They are rules that SQL Server Database Engine enforces for you. There are various types of constraints, each of which enforces a specific rule. All of the built-in constraints are enforced before a data change is made to the database so that if a constraint is violated, the modification statement is not executed. This way, there is no rollback of data necessary if the constraint is violated.
SQL Server 2005 provides the following types of constraints:
PRIMARY KEY constraints
FOREIGN KEY constraints
NULL/NOT NULL constraints
The following sections will describe ...