When renaming a table, dependent objects are not renamed

Refactors and formats SQL code.

When renaming a table, dependent objects are not renamed

Postby ffoulks » Thu Jul 02, 2009 3:14 pm

When I use Smart Rename to rename a table, neither the foreign keys nor the defaults are renamed. Suppose I have two tables, Table1 and Table2, and that Table1 has a relation that refers to Table2. SQL Server names this relation:

FK_Table1_Table2

Then I change the name of Table1 to Table1Rev with Smart Rename. The name of the foreign key should now be

FK_Table1Rev_Table2.

However, the change script generated by Smart Rename does not change the name of the foreign key.
ffoulks
 
Posts: 1
Joined: Thu Jul 02, 2009 2:57 pm
Location: Indiana University School of Medicine

Postby Brian Donahue » Thu Jul 02, 2009 3:55 pm

Hello,

I'm sorry to say that SQL Refactor is not designed to automatically rename constraints when the table name changes. We can consider this as a feature request for a future version if there is sufficient demand.

Thanks!
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am


Return to SQL Refactor 1

Who is online

Users browsing this forum: No registered users and 0 guests