Error using cmdline with Data Compare
ryanmorrisroe
Posts: 12 Bronze 1
I'm having an issue with the command line interface of DataCompare. My target db has a table that my source db does not (I only care about one table within the two databases). If I run my project from the DataCompare GUI everything works fine (a line shows up saying "1 Table or View could not be compared" but otherwise nothing is out of the ordinary), but when I run it from the command line I get:
Registering databases
Mapping
Comparing databases
Error: Object reference not set to an instance of an object.
If I physically remove the extra table from the target this error does not occur through the command line. I've been unable to find a way to remove the extra table from appearing in the "Tables and Views" section in the GUI (it shows up in the target db with blank fields for the source db, it also appears in the unmapped section on the mapping tab) - I feel like this is causing the error to be thrown. So far no combination of /Include or /Exclude switches has solved this problem.
Registering databases
Mapping
Comparing databases
Error: Object reference not set to an instance of an object.
If I physically remove the extra table from the target this error does not occur through the command line. I've been unable to find a way to remove the extra table from appearing in the "Tables and Views" section in the GUI (it shows up in the target db with blank fields for the source db, it also appears in the unmapped section on the mapping tab) - I feel like this is causing the error to be thrown. So far no combination of /Include or /Exclude switches has solved this problem.
Comments
I'll try to replicate your steps here and see if I can get the same thing - you should be able to use the exclude switch as far as I know, so it may be worth sending over your full command - if you want to mail support directly, we have a ticket open for this, so please quote F0046838 in the subject line.
Redgate Software
My .bat file is:
C:
cd "C:\Program Files (x86)\Red Gate\SQL Data Compare 9"
sqldatacompare /Project:"C:\DataSynch\Testing.sdc" /Exclude:"table:extratable" /Verbose /Synch >> C:\DataSynch\log.txt
which still gives me the Error: Object reference not set to an instance of an object message.
extratable is the name of the additional table that is only present in the target db.
Redgate Software
Redgate Software
Redgate Software
Ignore that.
Clipboard fail! That's actually a SQL Backup article.
You need to refer to this: http://www.red-gate.com/messageboard/viewtopic.php?t=13265
Redgate Software