Options

Command line error

Hi, I wonder if you can help. I'm trying to execute a data compare project from a command line and I'm getting the message:
'sqldatacompare' is not recognised as an internal or external command.

The code I'm putting in the command line is:

c:\sqldatacompare /Project:"C:\Redgate\TestProject.sdc"

Any help would be gratefully received.

Thanks

Comments

  • Options
    Hi Annette,

    Thanks for your post. Assuming you are trying to run this as part of a scheduled job (i.e. in a batch file), the code in the batch file will need to look something like:
    @echo off
    "C:\Program Files (x86)\Red Gate\SQL Data Compare 9\sqldatacompare.exe" sqldatacompare /Project:"C:\Redgate\TestProject.sdc" 
    

    So, essentially you need to ensure that you specify the install path in the file.

    HTH!

    Pete
    Peter Peart
    Red Gate Software Ltd
    +44 (0)870 160 0037 ext. 8569
    1 866 RED GATE ext. 8569
  • Options
    That's great and is working fine. My next issue is how to get it, through the batch file, to export to a CSV? Can you help with this please or should I put this as another question?
  • Options
    No problem:
    @echo off
    "C:\Program Files (x86)\Red Gate\SQL Data Compare 9\sqldatacompare.exe" sqldatacompare /Project:"C:\Redgate\TestProject.sdc" /export:"C:\SQLDataCompareReports\Differences.csv" /force
    

    The /force switch overwrites any existing Differences.csv file that you have in that location. For a full list of switches available, you can CD to the install path and then run the following from the command line:
    sqldatacompare /Help /Verbose /Html > "C:\SQLDataCompare9_Help.html"
    

    This should then create a file viewable in your browser of choice with a full list of switches.

    HTH!

    Pete
    Peter Peart
    Red Gate Software Ltd
    +44 (0)870 160 0037 ext. 8569
    1 866 RED GATE ext. 8569
  • Options
    Wow, that is absolutely fantastic and working perfectly. many many thanks.
  • Options
    You're welcome :)
    Peter Peart
    Red Gate Software Ltd
    +44 (0)870 160 0037 ext. 8569
    1 866 RED GATE ext. 8569
Sign In or Register to comment.