promote unique key to primary key?

  • On of the central tables in our system has a unique constraint defined on a column that should have been the primary key. Although I can add the primary key (neither are clustered), before I can drop the index I need to drop any and all foreign key constraints that reference this column.

    So, my question is - how do I point my foreign keys to the new primary key without having to laboriously drop and recreate each one?

  • ifx (4/10/2008)


    On of the central tables in our system has a unique constraint defined on a column that should have been the primary key. Although I can add the primary key (neither are clustered), before I can drop the index I need to drop any and all foreign key constraints that reference this column.

    So, my question is - how do I point my foreign keys to the new primary key without having to laboriously drop and recreate each one?

    You're going to have to drop and recreate the foreign keys. That's not exactly a laborious task though - should be pretty straight forward.

  • Thanks, Oh well - its more of a pain than anything else - especially when you know it can't be more than a reference in a hidden system table somewhere...

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply