Forcing a command line sync that has benign errors
Megan.Oneill
Posts: 2
I am attempting to use SQL Compare via the command line to baseline our QA database to match our Production database before applying changes from our source control.
However, one of the changes in this comparison causes the following error:
Error: Synchronization of <DB1> and <DB2> failed: String or binary data would be truncated.
If I were using the UI, I would be able to proceed past this error and sync the databases in spite of the warning.
I saw another post regarding this error, and the recommended solution was to edit the script generated by the SQL Compare to set ANSI_WARNINGS to OFF. However, I am attempting to fully automate this process. Is there a way I can force the synchronization without having to manually edit the sql script generated by SQL Compare?
Thanks,
Megan
UPDATE: Apparently the UI does not allow this either. Please disregard this post.
However, one of the changes in this comparison causes the following error:
Error: Synchronization of <DB1> and <DB2> failed: String or binary data would be truncated.
If I were using the UI, I would be able to proceed past this error and sync the databases in spite of the warning.
I saw another post regarding this error, and the recommended solution was to edit the script generated by the SQL Compare to set ANSI_WARNINGS to OFF. However, I am attempting to fully automate this process. Is there a way I can force the synchronization without having to manually edit the sql script generated by SQL Compare?
Thanks,
Megan
UPDATE: Apparently the UI does not allow this either. Please disregard this post.
Comments
I could never manage to get around this myself, except to save the script and set ANSI_WARNINGS at the top and run it in SSMS. You can set ANSI_WARNINGS in the database settings but last I checked that didn't have an effect. My conclusion was you have to set it in the SQL session (the script).
The alternative would be to adjust the schema so the second database has the same size columns as the first database.