February 22, 2007 at 2:13 pm
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?
February 23, 2007 at 1:29 am
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
February 23, 2007 at 6:48 am
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