Urgent: Add a column to the primary group

  • Changes to be made on 450 tables

    All the tables have a composite primary key containig two columns

    let say pk_age on (ID,YEAR)

    now it is required to add a third column on the primary key pk_Age(ID,YEAR,STATUS)

    Doing this through the interface is time consuming.

    Need to automate this

    thanks

  • And, what are you looking for? The script to do this? A way of automating a script you have?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • You need to drop the primary key constraint first and then re-create it with a new column added to the primary key

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

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