Replacing the Primary key columns with surrogate keys

I am trying to replace all my primary key columns with surrogate keys and the relations too in large model having 1314 models. Can any one suggest me how to approach for this automation. Thanks in advance. ( I am new to this SAX BASIC).

  • Hi,

    I have a couple of questions. Do the surrogate keys already exist in the tables? If not and you plan on having the macro create them? Are they all going to be the same name or at least can they be derived from the table name or something similar? Are you going to remove all your PKs as well and just convert them to normal columns or remove them completely?

    If you're going to remove your current PKs and use the surrogate keys as the PK then this should (in theory) be fairly easy. I think you'd go through all your tables, take all the columns that are PKs now and convert them to regular columns or remove them completely. Then add your surrogate keys and make them the PK. This shouldn't require you to do anything to your relationships as it should (again in theory) pick up the new PKs and use that.

    If you can answer the questions above I may be able to put something together quickly and see if that works for you.

    Regards,
    Stan