How can we help you today? How can we help you today?

Error using cmdline with Data Compare

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.
ryanmorrisroe
0

Comments

9 comments

  • James B
    This sounds similar to an issue that some other users have reported recently, and we have logged as a bug.

    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.
    James B
    0
  • ryanmorrisroe
    Hello,
    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.
    ryanmorrisroe
    0
  • James B
    OK, I've just tested this here, and it looks like you are right. The exclude switch indeed appears to ignore the instruction to skip that table. We have a bug logged (SDC-1190) which may be related to this; so I'll update it with this thread. Hopefully it can get sorted out easily.
    James B
    0
  • ryanmorrisroe
    Thanks for the quick replies! For now I can just use the GUI (this was more of a test than a critical application), please let me know when the release is in place (my goal is to have this run as a scheduled Windows task).
    ryanmorrisroe
    0
  • James B
    No problem - I'll update this post when I get notified of a fix!
    James B
    0
  • James B
    I just spotted this thread - the problem was also reported here: http://www.red-gate.com/supportcenter/Content?c=knowledgebase%5cSQL_Backup%5cKB200903000369.htm&p=SQL%20Backup and that details a patch that should fix the problem.
    James B
    0
  • ryanmorrisroe
    I can try that registry fix, but I'm a little skeptical that authentication is cuasing this issue, as it can see the table that exists in both databases perfectly fine and works fine if the extra table is removed...
    ryanmorrisroe
    0
  • James B
    Registry fix? Ah - wrong link.
    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
    James B
    0
  • ryanmorrisroe
    That one makes more sense. I'll try out the patch and post back if it's successfull. Thanks!
    ryanmorrisroe
    0

Add comment

Please sign in to leave a comment.