Microsoft® SQL Server™ 2005 Administrator's Companion
by Edward Whalen, Marcilina Garcia, Burzin Patel, Stacia Misner, Victor Isakov
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access