SQL Compare Command Line w/Filter
LukeRogers
Posts: 3
As part of my CI build I need to sync only the Views and to do this I am using a saved Filter. Here is the command I am running:
SQLCompare.exe /database1:DB1 /s1:SERVER /database2:DB2 /s2:SERVER /Filter:C:CompareFilterviewsonly.scpf /synchronize
If there are changes to be synchronized everything works great but if the databases are identical I get
Am I missing something? Is there something I can do to suppress this error since it's there are no changes necessary?
SQLCompare.exe /database1:DB1 /s1:SERVER /database2:DB2 /s2:SERVER /Filter:C:CompareFilterviewsonly.scpf /synchronize
If there are changes to be synchronized everything works great but if the databases are identical I get
Since this is a filter I can't use /Include:Identical and I can't find any way around getting this error. It makes my CI builds look like they have issues when in fact they don't so when I DO have an issue it's easy to miss since it looks the same (error)."Error: The selected objects are identical or no objects have been selected in the comparison."
Am I missing something? Is there something I can do to suppress this error since it's there are no changes necessary?
Comments
You didn't mention which version of SQL Compare you were using, but you should be able to use the /Assertidentical switch to suppress the error and return an exit code of 0 if the databases are identical.
Redgate Software
When I try the /AssertIdentical flag with version 11 I get the following error:
I was hoping to have everything handled in one step but if I need two steps (check if there are changes, if so, synchronize) I'm okay with it, I just don't know how to do it. Any ideas?
What you could do is detect the value of the environment variable %ERRORLEVEL% and if it is equal to 0, proceed with the synchronization step.
How are you currently handling your CI? Have you had a look at our SQL Automation Pack? You might also want to have a look at our Continuous Integration page that is part of our Database Lifecycle Management section.
Redgate Software