O'Reilly logo

Microsoft® SQL Server™ 2000 Programming by Example by Carlos Eduardo Rojas, Fernando G. Guerrero

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: Constraints (Declarative Data Integrity)

SQL Server uses Transact-SQL structures to enforce data integrity. You can create these structures during table creation or by altering the table definition after the creation of the table and even after data has been inserted into the table.

To enforce entity integrity, SQL Server uses PRIMARY KEY and UNIQUE constraints, UNIQUE indexes, and the IDENTITY property. UNIQUE indexes are covered in Chapter 6, "Optimizing Access to Data: Indexes."

Note

The IDENTITY function is used to create an IDENTITY field in a table created by using the SELECT INTO statement.

For domain integrity, SQL Server provides system-supplied and user-defined data types, CHECK constraints, DEFAULT definitions, ...

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