HELP Renamed table for backup but containt follows new name?

  • I have renamed an old table with a backup name and created a new table with the original name of the old one. Most everything followed the new name but there are some constraints that don't follow the table name. These appear to follow some kind of object identity that ignors the name of the table?

    What is the best way to move these constraints?

     

  • Drop them and recreate with the new name. Constrants (primary key, unique, foreign key) are objects themselves and don't depend upon the tables for their names.

    Your indexes also won't have changed name, but since you can have multiple indexes with the same name (on different tables) its not a concern.

    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
  • Great thanks Gila.

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

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