O'Reilly logo

Microsoft SQL Server 2014 Unleashed by Paul Bertucci, Alex T. Silverstein, Chris Gallelli, Ray Rankins

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

The FOREIGN KEY Referential Integrity Constraint

The basic premise of a relational database is that tables are related. These relationships are maintained and enforced via referential integrity. FOREIGN KEY constraints are the declarative means for enforcing referential integrity in SQL Server. You implement FOREIGN KEY constraints by relating one or more columns in a table to the columns in a primary key or unique index. The columns in the referencing table can be referred to as foreign key columns. The table with the primary key or unique index can be referred to as the primary table. Figure 23.2 shows a relationship between the BusinessEntityAddress table and AddressType table. The foreign key in this example is AddressTypeID on the BusinessEntityAddress ...

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