add identity to existing primary key column

  • hi folks,

    can any one help in adding identity to existing primary key column and that key is referred as foreign key

    some other tables

  • Here are the steps:

    1) drop the foreign keys

    2) Add the identity column to the table

    3) Add a field to the related tables to hold the new identity column

    4) Update the newly created field in the related tables with the new identity field based on the original key fields

    5) Create new foreign keys

    enjoy!

    --------------------------------------------------------------------------
    When you realize you've dug yourself into a hole....Step 1...stop digging.

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

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