I use SSDT to synchronize two databases.
For this, I have a database in Server1, a database in Server2, and a schema in my project.
I always make changes to the Server1 database and apply these changes to the Server2 database. For this, I use this workflow:
- Compare the Server1 database with the Schema and update the Schema with Server1 changes.
- Compare the schema to the Server2 database and update the changes from the schema to the database
This is usually normal, but I found the problem the last time I rename columns in a table.
Usually, if I rename columns in a table, this change appears as a column rename, so when I compare Server1 with Schema, column renames are detected correctly, and I can safely end my workflow.
However, the last time I renamed the columns in the table in Server1, comparing it to Schema, instead of detecting a change as the renaming of the column, it detected this change as a forwarding column (with the old name) and creating a column (with new name). Obviously, if I applied these changes to the Server2 database, I will lose all the data in the renamed column.
Is there a reason for this behavior in SSDT? Can I make SSDT understand that this is a column rename?
I know how to do this manually, but I would prefer to avoid this problem in SSDT or solve it if it appears again in the future.
sql-server-2012 ssdt
Jotabe
source share