Search code examples
sqlsql-server-2005primary-key

How to change value of primary key and update foreign key in the same time


I have a record in table with wrong primary key. I want change it to correct value, but this value is used in many other tables.

Is there any simple way to update primary key and foreign key at the same tim?


Solution

  • If the foreign keys are set to cascade changes then the value should change automatically.