Error running SQL Compare using NAnt

hmopthmopt Posts: 3
edited July 31, 2006 12:01PM in SQL Compare Previous Versions
Hi,
I am using SQL Compare Pro. When I run SQLCompare.exe from the the command line, I am able to get the results but when I call it via an NAnt script, it fails and I get the following error -

'C:\Program Files\Red Gate\SQL Bundle 5\SQLCompare /database1:DB1 /database2:DB2' failed to start.
The filename, directory name, or volume label syntax is incorrect

Can you please help.

Thank you.

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi,

    I think that the difference in behaviour could be accounted for by the user account that NANT uses to run the script. Can this account log into the databases using Windows Authentication? If not, you may want to specify usernames and passwords for the comparison.

    There could also be an issue with rights to the folder pointed to by the TMP environment variable for that user. If the NAnt test is running as LocalSystem, make sure the environment variable TMP is set to a valid directory in the environment settings for the System.
  • Brian,
    Thank you for your reply. My script uses Windows Authentication. And I checked the TMP folder environment variable and it is set a correct value. This is interesting...I ran my script again but this time I called SQLCompare without passing in any parameters:
    <target name="synch.db" >
    <exec program="${SQLCompare}" />
    </target>
    (where SQLCompare is set to "C:\Program Files\Red Gate\SQL Bundle 5\SQLCompare.exe")
    I did get an error message saying that i need to specify atleast the necessary parameters for SQLCompare to work. This means, my Nant script is able to call SQLCompare successfully and SQLCompare is getting executed. But when I changed my script to,
    <exec program="${SQLCompare} /verbose" />
    it failed giving me the error "'C:\Program Files\Red Gate\SQL Bundle 5\SQLCompare.exe /verbose' failed to start
    The system cannot find the path specified"

    I thinkg its got to do something with the '/'. I even tried to put a '\' before all the '/' in my command line parameter list but that didnt work either. Is there anyway i can specify my parameters without the '/'. (I can use an xml file for my parametrs but even then i would have to use /arglist).

    Thanks for you help.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hello,

    Sorry I don't think I can help. Is it possible to set a working directory in Nant? Are the arguments separate from the path to executable? Maybe setting a working directory and/or specifying some valid arguments will help.

    I'm pretty sure that this error is coming from Nant and the answer must lie with them.
Sign In or Register to comment.