Sql-server – Changing field length when foreign keys reference primary key field in table

sql serversql-server-2008

I have a situation where a number of foreign keys are referencing a column in Table "A". I would like to change the length of the column in table "A". What is the best way to accomplish this in SQL Server 2008 R2? I am really hoping I don't have to drop all 30 foreign key constraints and re-create them again…

Best Answer

  1. Script out Drop and Create All 30 JF.
  2. Drop all 30 KF
  3. Alter Columns
  4. Create all 30 KF