what happens to data in target database when redgate sql compare syncs the two database

10raw10raw Posts: 20 Bronze 1
edited July 24, 2018 6:39PM in SQL Compare

is there any way to retain current data and syn the structure change only in case we loose data.

Thanks

Best Answer

  • AlexYatesAlexYates Posts: 264 Rose Gold 2
    I'm not sure I understand exactly.

    The default functionality is that SQL Source Control/Compare/SQL Change Automation will deploy the schema but not the data. So data in the target database will be safe.

    Now, in some scenarios SQL Compare might not know how to do this. Table renames are the obvious example - SQL Compare has a tendency to interpret that as a drop and create - and the data gets blown away. With this in mind, make sure you are aware of any warnings about potential data loss.

    To get around the data loss either use "migration scripts" in SQL Source Control or revert to a manual deployment on this occasion if SQL Compare cannot handle it. Alternatively switch to using the SQL Change Automation Visual Studio plug-in (previously known as ReadyRoll). Generally, if this is only a rare issue I'd stick with SQL Source Control, but if this is a regular problem it may make sense to switch to SQL Change Automation.
    Alex Yates
    DevOps Mentor and Coach

    Director of DLM Consultants
    Creator of Speaking Mentors
    Microsoft Data Platform MVP
    Friend of Redgate
    Twitter / LinkedIn

Answers

Sign In or Register to comment.