O'Reilly logo

Microsoft® SQL Server™ 2005 Administrator's Companion by Victor Isakov, Stacia Misner, Burzin Patel, Marcilina Garcia, Edward Whalen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Enforcing Integrity with Constraints

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

  • UNIQUE constraints

  • FOREIGN KEY constraints

  • CHECK constraints

  • DEFAULT definitions

  • NULL/NOT NULL constraints

The following sections will describe ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required