No transaction in XML argfile
si_he
Posts: 25
Please can someone explain how I can set the commandline object to not use transactions within options?
I have tried using the following in the XML file:
<options>None</option> and <options> option1, option2.. option n </options>
But I receive the following error on mapping:
Error: Object reference not set to an instance of an object.
Thanks
I have tried using the following in the XML file:
<options>None</option> and <options> option1, option2.. option n </options>
But I receive the following error on mapping:
Error: Object reference not set to an instance of an object.
Thanks
Comments
This should work as you describe. Possibly there is another cause for the error message? This sounds more like a failure in the program than an incorrect option. The message should read 'invalid option' rather than chucking a null-reference exception at you. I had tried something similar to your argfile, specifying the N (none) and oc (output comments) options, which has diabbled the transactions in the SQL script output by Data Compare:
Maybe you should try these options, then if there is still a problem, use the GUI version of Data Compare and see if it throws a more 'friendly' error message.
Thanks!
SQL Data Compare running with SQL Option: None (OK).
SQL Data Compare running with Mapping Option: None (OK).
SQL Data Compare running with Comparison Option: None (OK).
SQL Data Compare running with SQL Option: OutputComments (OK).
This must be the reason for the object reference not set error. I included 'includeidentities' in the <options> clause and it fixed the issue with my problem.
Cheers
The GUI runs fine with the same settings.
Help...
Thanks!
<commandline>
<database1>*****</database1>
<server1>*****</server1>
<username1>*****</username1>
<password1>*****</password1>
<database2>*****</database2>
<server2>*****</server2>
<include>Table</include>
<include>Table:*****</include>
<include>Table:*****</include>
<columns>*****</columns>
<include>Table:*****</include>
<exclude>Table:*****</exclude>
<exclude>Table:*****</exclude>
<options>n</options>
<synchronize/>
</commandline>
It works differently for me if I use the default options or if I set options=n. With no options, the transactional stuff doesn't appear in the script. Are you on the latest version of SQLDATACOMPARE.exe? It should read 5.2.0.50.
Thanks!
I think a nice feature would be to have a script generater from the GUI settings to commandline or XML file.
Thank you
You can create projects in Data Compare and save them and run them from the command line. In Data Compare, right-click the project and select 'locate on disk'. Then you can copy the settings file to another folder and run it in sqldatacompare.exe using the /pr switch. One problem, the custom mappings don't seem to be respected.