Showing what DC will do, before having it actually do it.

stiej1977stiej1977 Posts: 12
How do I see what exactly the DataCompare Command Line version will go and do if allowed.

We use sqldataacompare.exe with an xml file containing tables to include/exclude and I can't work out how to amend the command line syntax to produce an output of what it would intend to do.

What is the command line syntax for this, when using /argfile?

Many thanks.

Comments

  • Eddie DEddie D Posts: 1,648 Rose Gold 5
    Thank you for your post into forum.

    Using the CLI, you can write out the migration or synchronization script to a specified file using the /scriptfile:<scriptfile> argument.

    Also you can specify the script encoding using the /scriptencoding:<scriptencoding>
    Character encoding to use when writing script file can be one of these values:

    UTF8 - UTF8 encoding, without preamble.
    UTF8WithPreamble - UTF8 encoding, with 3 byte preamble.
    Unicode - UTF16 encoding.
    ASCII - ASCII endoing.

    An example XML Agument File may look like this example:

    <?xml version="1.0"?> <commandline><database1>FirstDatabaseName</database1><username1>Username1</username1> <password1>Password1</password1> <database2>SecondDatabaseName</database2> <username2>Username2</username2> <password2>Password2</password2>
    <scriptfile>C:\MyScripts\SDC\Sync.txt</scriptfile>
    <scriptencoding>UTF8</scriptencoding>
    <Force/> </commandline>

    The force switch is required to overwrite an existing file. If the file already exists and the force switch is not present, the program will exit with an error code.

    If you wish toredirect the console output to a specified file, use the /out:<filename> argument:

    <?xml version="1.0"?> <commandline><database1>FirstDatabaseName</database1><username1>Username1</username1> <password1>Password1</password1> <database2>SecondDatabaseName</database2> <username2>Username2</username2> <password2>Password2</password2>
    <out>C:\compareResults\compare.txt</out>
    <scriptfile>C:\MyScripts\SDC\Sync.txt</scriptfile>
    <scriptencoding>UTF8</scriptencoding>
    <Force/> </commandline>

    I hope this answers your question.

    Many Thanks
    Eddie

    Eddie Davis
    Product Support Engineer
    Red Gate Software Lyd
    e-mail: [email protected]d-gate.com
    Eddie Davis
    Product Support Engineer
    Redgate Software Ltd
    Email: [email protected]
  • Many thanks for the reply. If I use the scriptfile argument, does that stop it from actually applying the changes? or does it script the changes AND apply them?
  • Eddie DEddie D Posts: 1,648 Rose Gold 5
    Thank you for your reply.

    The scriptfile argument will only generate a synchronization script.

    If you wish to also synchronize you need to specify <synchronize/> element, into the argument file.

    For example your XML arument file may look similar to this:

    <?xml version="1.0"?> <commandline><database1>FirstDatabaseName</database1><username1>Username1</username1> <password1>Password1</password1> <database2>SecondDatabaseName</database2> <username2>Username2</username2> <password2>Password2</password2>
    <scriptfile>C:\MyScripts\SDC\Sync.txt</scriptfile>
    <scriptencoding>UTF8</scriptencoding>
    <Force/> <synchronize/>
    </commandline>

    Please take a look at the SQL Compare Helpfile ->Command Line Interface section. The helpfile contains further advice on use of the command line and it's options.

    Many Thanks
    Eddie

    Eddie Davis
    Product Support Engineer
    Red Gate Software Ltd
    e-mail: [email protected]
    Eddie Davis
    Product Support Engineer
    Redgate Software Ltd
    Email: [email protected]
  • Excellent! Many thanks for the help. that'll do me nicely.
Sign In or Register to comment.