Udostępnij za pośrednictwem


Foreign Keys (Visual Database Tools)

A foreign key constraint works in conjunction with primary key or unique constraints to enforce referential integrity among specified tables. For example, you can place a foreign key constraint on the title_id column in the publishers table to ensure that a value entered in that column matches an existing value in the title_id column of the titles table.

For more information about creating relationships, see How to: Create Relationships Between Tables and Working with Relationships.

For information about

See

Which columns participate in the foreign key side of a relationship

How to: View Foreign Key Properties

Changing which columns are related to columns in the primary key table

How to: Modify Foreign Key Relationships

Checking existing data when creating a relationship

How to: Check Existing Data when Creating a Relationship

Disabling a foreign key constraint during INSERT and UPDATE transactions

How to: Disable Foreign Key Constraints with INSERT and UPDATE Statements

Disabling a foreign key constraint during replication of the table

How to: Disable Foreign Key Constraints for Replication

Removing the requirement to enforce referential integrity between primary key columns and the related columns in another table

How to: Delete Foreign Key Relationships

See Also

Reference

Foreign Key Relationships Dialog Box

Other Resources

Working with Relationships

Working with Keys