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

Sign In or Register to comment.