Options

Path to snapshot - invalid command line argument

SuleonSuleon Posts: 17
Hello!

I want to call SQLCompare.exe with a command line argument for a snapshot. If I only use the filename (file in same directory as exe) all works fine. But when the file is in another directory I get an error:

works:
SQLCompare.exe /server2 SERVER/database2 DATABASE /username2 SA /password2 PASSWORD /snapshot1 SNAPSHOT.snp /sync

does not work:
SQLCompare.exe /server2 SERVER/database2 DATABASE /username2 SA /password2 PASSWORD /snapshot1 d:/SNAPSHOT.snp /sync

I also tried:
SQLCompare.exe /server2 SERVER/database2 DATABASE /username2 SA /password2 PASSWORD /snapshot1 'd:/SNAPSHOT.snp' /sync
SQLCompare.exe /server2 SERVER/database2 DATABASE /username2 SA /password2 PASSWORD /snapshot1 "d:/SNAPSHOT.snp" /sync
SQLCompare.exe /server2 SERVER/database2 DATABASE /username2 SA /password2 PASSWORD /snapshot1 d:\SNAPSHOT.snp /sync
...

the error message is: Error: Invalid command-line argument

What is the correct syntax for file paths?

Regards
Susanne

Comments

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

    I think it should be:
    SQLCompare.exe /server2:"SERVER\database2" /database2:DATABASE /username2:SA /password2:PASSWORD /snapshot1:"d:/SNAPSHOT.snp" /sync
    
    I'm not sure why the word DATABASE is hanging out all on its' own. I think SQL instance names should always be separated by a backslash rather than a forward-slash.

    Hope this helps!
  • Options
    Hi Brian,

    I overlooked the colon. With that and the quotes now all works fine.

    The DATABASE belongs to /database2. I just forgot a space.

    Thank you!

    Susanne
Sign In or Register to comment.