Renaming table loses data

Jeff ClarkJeff Clark Posts: 14
If I rename a table and check the changes into source control, when I run SQL Compare of the sourced controlled schema against another database, the change script generated simply drops the table with the old and creates one with the new name without copying the data. The documentation noted that Source Control would show the rename event as a drop and create, but it did not note that it would lose all data in the table during the event. Is there a way around this?

SQL Server 2008 and above have a DDL RENAME trigger. Can you use this trigger to smartly handle rename of tables?

Using SQL Compare 11.2.1.82, SQL Source Control 4.0.0.181, and SQL Server 2014 Enterprirse.

Any ideas how to make this work?

Comments

Sign In or Register to comment.