Constraints, Rules, Defaults, and Triggers

SQL Server Architecture

SQL Server Architecture

Constraints, Rules, Defaults, and Triggers

Table columns have properties other than data type and size. These other properties are an important part in ensuring the integrity of data in a database:

  • Data integrity refers to each occurrence of a column having a correct data value.

    The data values must be of the right data type and in the correct domain.

  • Referential integrity indicates that the relationships between tables have been properly maintained.

    Data in one table should only point to existing rows in another table; it should not point to rows that do not exist.

Objects used to maintain both types of integrity include:

  • Constraints

  • Rules

  • Defaults

  • Triggers