command-lineredgatesqlcompare

redgate sql compare results differ using gui to command line


Using SQL Compare 10, I've created an .scp file which compares a local database (on the local build server) with what's in Source control (TFS via redgate SQL Source Control)

Using the GUI a number of differences are listed.

When running the .scp file from the command line, no differences are listed at all. - "The selected objects are identical or no objects have been selected in the comparison"

Command line is

"C:\Program Files (x86)\Red Gate\SQL Compare 10\sqlcompare.exe" /project:"C:\Users\CIUser\Documents\SQL Compare\SharedProjects\MyDBName v MyDBName (Head).scp" /scriptfile:deploy_MyDBName.sql /include:identical /force

NB

The /include:/identical switch means the compare will not report an error if no changes are detected
The /force switch forces an overwrite of the sql script, rather than causing an error

Solution

  • OK, solved this, although it seems a little obtuse to me, to say the least.

    Prior to saving the project file (or at least before running it from the command line) you need to:

    a) You have to run the compare - BUT.. the comparison needs to pick up some differences

    b) As it has picked up some differences, when the results are shown, in the heading row, you need to check the tickbox between the 2 "Object Name" columns, and then

    c) save your project.

    Though the project file is a text / XML file, doing the above steps adds some encrypted guff in the file, that seems to make it work - i.e it's not simply changing one of the xml values to True that was False.

    Hope this helps someone... There must surely be a better way of fixing this...