Updating tables with foreign key constraints

24 Mar

- Delete the now-unused parent key row This is awkward for any number of obvious reasons, and may not be suitable to your implementation, but it maintains referential integrity within the database.

Microsoft is conducting an online survey to understand your opinion of the Msdn Web site.

The table containing the foreign key is called the child table, and the table containing the candidate key is called the referenced or parent table.

Look at the following two tables: "Persons" table: Notice that the "Person ID" column in the "Orders" table points to the "Person ID" column in the "Persons" table.

A FOREIGN KEY is a key used to link two tables together.

updating tables with foreign key constraints-72updating tables with foreign key constraints-39

Foreign key constraints may be created by referencing a primary or unique key.Foreign key constraints ensure the relational integrity of data in associated tables.A foreign key value may be NULL and indicates a particular record has no parent record.But if a value exists, then it is bound to have an associated value in a parent table.When applying update or delete operations on parent tables there may be different requirements about the effect on associated values in child tables.