The 'best' (and only reliable) method is to script out the constraints, drop the constraints, edit the scripts for the new table name, and execute the scripts.
Arnie Rowland, MVP (SQL Server)
"You cannot do a kindness too soon because you never know how soon it will be too late."
-Ralph Waldo Emerson
] On Behalf Of J P
Sent: Wednesday, March 03, 2010 1:58 PM
Subject: [SQLQueriesNoCode] Table rename affecting Foreign Keys
I renamed a table from 'table' to 'table2', and I created 'table'. I would like 'table' to become the FK source for the constraints, which all seem to point to 'table2' now (i.e. the constraints captured the rename). What is the best method to relink the child tables to the new parent table?
[Non-text portions of this message have been removed]
Yahoo! Groups Links
Disclaimer - March 3, 2010
This email and any files transmitted with it are confidential and intended solely for SQLQueriesNoCode@yahoogroups.com
. If you are not the named addressee you should not disseminate, distribute, copy or alter this email. Any views or opinions presented in this email are solely those of the author and might not represent those of Westwood Consulting, Inc. Warning: Although Westwood Consulting, Inc has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments.
This disclaimer was added by Policy Patrol: http://www.policypatrol.com/