Here are the constraints used in SQL Server 2012 to help with the integrity problem that otherwise will occur.
There are five different kinds of constraints which are used to enforce the integrity of the tables in the relational model.
1. Primary Key, this one is used to identify a unique row and you can not have null values here. This is often used as some kind of int to identify different customers or orders in a table. The primary key creates a unique index to help create uniqueness and speed up queries.
2. Foreign Key, are used to point to another table with a primary key or unique constraint to restrict the values in the foreign key column to those in the other table with the primary key/unique constraint. These tables are also called “referenced tables”. This connection sometimes provide a problem when deleting rows in a table. This can be adjusted/configured with the “cascade” option.
3. Unique, enforces uniqueness of a row – you can have multiple of these in a table.
4. Check, are used to make a predicate that says something about what can be inserted in the table, i.e. only put in products that has the value greater than 200. This constraint will reject updates or inserts that does not comply with the predicate.
5. Default, this is used to create a default value when you choose not to enter a value for some columns. Then this default value will be used.