Sql updating tables with foreign keys

You can select from that table to get all the information you need.

A post from John Paul Cook can be found here: ( This code will drop and create ALL FK constraints in a database.

When more than one column is combined to form a unique key, their combined value is used to access each row and maintain uniqueness.

Values are not combined, they are compared using their data types.

However, you cannot change the length of a column that is defined with a FOREIGN KEY constraint.

When a FOREIGN KEY constraint is added to an existing column or columns in the table, by default, the Database Engine examines the existing data in the columns to make sure that all values, except NULL, exist in the columns of the referenced PRIMARY KEY or UNIQUE constraint.

However, by specifying WITH NOCHECK, the Database Engine can be prevented from checking the data in the column against the new constraint and made to add the new constraint regardless of the data in the column.

, I see that update_referential_action is set to 0.

Thus NO ACTION is taken after updating my primary keys columns.

Leave a Reply