Summary

In this chapter, we have learned the importance of database integrity and how to use the built-in capabilities of SQL Server 2005 to help ensure that the data in a database remains accurate and correct. The use of database constraints to enforce data integrity is the preferred method.

Domain, entity, and referential integrity are enforced with the various constraint types available in SQL Server:

  • PRIMARY KEY Constraints

  • UNIQUE Constraints

  • FOREIGN KEY Constraints

  • CHECK Constraints

  • NULL and NOT NULL Constraints

  • DEFAULT Definitions

All of these constraints were described in this chapter along with examples of how to create and modify each, using T-SQL and using SQL Server Management Studio. Following is a consolidated example of a table creation ...

Get Microsoft® SQL Server™ 2005 Administrator's Companion now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.