September 13, 2017 at 6:49 am
Hi,
I have a table Item with a Primary Key Constraint. A foreign key is created with 6 other tables referring Item's Primary key. I want to include another column in the Primary Key. I tried disabling the foreign key and primary key but i am not able to drop the primary key from the Item table.
Can someone please suggest how to alter the primary without dropping the foreign key? Is that possible?
September 13, 2017 at 7:06 am
nope, you have to drop the foreign keys that reference the PK, then drop the PK, then recreate a new PK and -the foreign keys so they now feature the new two column constraint.
if you wanted the foregin key to reference just one part of the new-multi column PK, then you need a unique constraint on that column for the FK to attach to.
Lowell
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply