Renaming tables

einareinar Posts: 4
The new version of the database schema has one of the old tables renamed.

When I compare with SQL Compare the new and old DB, SQL Compare wants to drop the old table (I assume I loose all the data then) and create a new table with the new name.

Is there any way to get SQL Compare to handle this situation differently. Can I somehow tell it that the "new" table is just a rename of an old table and thata data should be preserved?

Comments

  • Unfortunately, there isn't an option to do this yet. I've added this thread to the feature request for this feature.

    If you have Data Compare, you could synchronize the new table across, unchecking the old table so that it is not dropped, and then use Data Compare's table mapping feature to move the data from one table to the other.
    Software Developer
    Redgate Software
  • I am trying to produce a report of database differences, and the lack of support for object renames is unfortunate because it shows renamed objects as unrelated Add and Drops.

    Here is basically a feature request:

    When comparing databases, it would be nice to have a table of name equivalences or renames to use in order to determine if two objects are the same.

    For example, suppose a database had the MyTable table and associated view misspelled.

    MyTabel==MyTable
    vMyTabel==vMyTable

    Then the synchronizer would recognize the rename, and compare the objects.

    This would be better than requiring resync in the UI (like CA ERwin) which requires an annoying number of mouse clicks and does not persist the equivalence. Everytime you refresh the comparison, you have to re-sync the renames. With an equivalence table, you could add more equivalences to the comparison, and then refresh the comparison.

    Is such a feature planned?
  • Michelle TMichelle T Posts: 566 Gold 1
    If we implement a table mapping feature in SQL Compare, it will probably look a lot like the table mapping feature in SQL Data Compare (although obviously less fussy about whether the column data types line up). It's a large project to implement it - we don't currently have it scheduled, but it is one of the features we're looking at for implementing in the next few versions.
    Software Developer
    Redgate Software
Sign In or Register to comment.