Red Gate forums :: View topic - Command-line error when passing arguments as a variable
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Compare 10
SQL Compare 10 forum

Command-line error when passing arguments as a variable

Search in SQL Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
tslagter



Joined: 10 Aug 2010
Posts: 3

PostPosted: Tue Sep 18, 2012 6:54 pm    Post subject: Command-line error when passing arguments as a variable Reply with quote

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
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1144
Location: My desk.

PostPosted: Thu Sep 20, 2012 7:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
tslagter



Joined: 10 Aug 2010
Posts: 3

PostPosted: Tue Sep 25, 2012 3:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1144
Location: My desk.

PostPosted: Thu Oct 11, 2012 5:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
tslagter



Joined: 10 Aug 2010
Posts: 3

PostPosted: Thu Oct 11, 2012 6:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1144
Location: My desk.

PostPosted: Thu Oct 11, 2012 6:32 pm    Post subject: Reply with quote

It may well be I'm on an earlier test version then - I'll check with the Compare team.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic 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