| Author |
Message |
tslagter
Joined: 10 Aug 2010 Posts: 3
|
Posted: Tue Sep 18, 2012 6:54 pm Post subject: Command-line error when passing arguments as a variable |
|
|
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:
| Code: |
set db1="/db1:database1"
set db2="/db2:database2"
sqlcompare.exe /s1:server1 /s2:server2 %db1% %db2%
|
The following fails (note the space in db1):
| Code: |
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. |
|
| Back to top |
|
 |
james.billings
Joined: 16 Jun 2010 Posts: 844 Location: My desk.
|
Posted: Thu Sep 20, 2012 7:51 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
tslagter
Joined: 10 Aug 2010 Posts: 3
|
Posted: Tue Sep 25, 2012 3:39 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
james.billings
Joined: 16 Jun 2010 Posts: 844 Location: My desk.
|
Posted: Thu Oct 11, 2012 5:24 pm Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
tslagter
Joined: 10 Aug 2010 Posts: 3
|
Posted: Thu Oct 11, 2012 6:07 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
james.billings
Joined: 16 Jun 2010 Posts: 844 Location: My desk.
|
Posted: Thu Oct 11, 2012 6:32 pm Post subject: |
|
|
| It may well be I'm on an earlier test version then - I'll check with the Compare team. |
|
| Back to top |
|
 |
|
|
All times are GMT + 1 Hour
|
| Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group