Options

Command-line error when passing arguments as a variable

tslagtertslagter Posts: 19 Bronze 2
edited October 11, 2012 1:32PM in SQL Compare Previous Versions
There appears to be a bug when building the command line argument list dynamically using variables. If an extra space is included at the beginning of a variable, the command fails.

For example, this works fine:
set db1="/db1:database1"
set db2="/db2:database2"
sqlcompare.exe /s1:server1 /s2:server2 %db1% %db2%

The following fails (note the space in db1):
set db1=" /db1:database1"
set db2="/db2:database2"
sqlcompare.exe /s1:server1 /s2:server2 %db1% %db2%
This returns: "Error: Invalid command-line argument: /database1. ..."

This error seems to occur for any argument passed as a variable that begins with a space; I originally found this building up a series of "/exclude" switches.

Comments

  • Options
    Thanks for your post - can I check what version of Compare you're using, as I tried this myself, and it seems to work okay.
    Systems Software Engineer

    Redgate Software

  • Options
    I'm using version 10.2.0.1337, Professional Edition, on Windows 7, sp1.

    This is a new script, so I'm not sure if it would have worked with a previous version.
  • Options
    Sorry for my delay in replying, i've been away for a couple of weeks. I'm currently on 10.2.2.x so it may well be something that's resolved in the update as you're on 10.0
    Systems Software Engineer

    Redgate Software

  • Options
    tslagtertslagter Posts: 19 Bronze 2
    I just updated SQL Compare to version 10.2.3.1, ran the code above in the command line, and got the same error.

    And, BTW, there doesn't seem to be any indication of a new version beyond 10.2.0.1337 - that's the latest post I see.
  • Options
    It may well be I'm on an earlier test version then - I'll check with the Compare team.
    Systems Software Engineer

    Redgate Software

Sign In or Register to comment.