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

Object reference not set to an instance of an object.

Hello,
I am getting this error when trying to use the following: SQLDataCompare" /pr liveNweb_data.sdc. The sdc file works perfectly when I open it using the windows tool, but I get the following error when using the cmd line:

Unexpected error: Object reference not set to an instance of an object.
Object reference not set to an instance of an object.
System.NullReferenceException
at _6._3(TableComparisonSetting , Fields )
at _6._2(TableComparisonSettings )
at RedGate.SQLDataCompare.CommandLine.Runner._2()
at RedGate.SQLDataCompare.CommandLine.Runner.GetExecutionBlock()
at RedGate.SQLDataCompare.CommandLine.Runner.Run()
at RedGate.SQLDataCompare.CommandLine.Startup._1(String[] )

How do I solve this?

Thanks,
Izzy
izzyb
0

Comments

8 comments

  • Brian Donahue
    Hi Izzy,

    What is the exact command you're giving it? I'd assume that either SQL Data Compare can't open the sdc file or one of the specified tables and columns aren't available to compare.
    Brian Donahue
    0
  • izzyb
    Hello,

    I am getting this error when trying to use the following: SQLDataCompare" /pr liveNweb_data.sdc. as a DOS command

    The sdc file works perfectly when I open it using the windows DataCompare.

    Izzy
    izzyb
    0
  • Brian Donahue
    Hello,

    Is that double-quote supposed to be there?
    Brian Donahue
    0
  • izzyb
    Nope you can ignore it.
    izzyb
    0
  • Brian Donahue
    Thanks... do you get any more information output if you use the /verbose switch?
    Brian Donahue
    0
  • izzyb
    Hello,
    Here is what I get with verbose:
    C:\Program Files\Red Gate SQL Bundle>SQLDataCompare /pr liveNweb_data.sdc /verbo
    se
    SQL Data Compare running with option: Default (OK).
    Loading synchronization parameters from project file: liveNweb_data.sdc
    OK
    Connecting to database 'syntezz_aaaaaa' on 'SYNTEZZA_LIVE'...
    OK
    Connecting to database 'Web_data' on 'SERVER-1'...
    OK
    Comparing database SYNTEZZA_LIVE.syntezz_aaaaaa with database SERVER-1.Web_data.
    ..
    Checking and setting comparison columns...
    OK
    Checking and setting comparison keys...
    Unexpected error: Object reference not set to an instance of an object.
    Object reference not set to an instance of an object.
    System.NullReferenceException
       at _6._3(TableComparisonSetting , Fields )
       at _6._2(TableComparisonSettings )
       at RedGate.SQLDataCompare.CommandLine.Runner._2()
       at RedGate.SQLDataCompare.CommandLine.Runner.GetExecutionBlock()
       at RedGate.SQLDataCompare.CommandLine.Runner.Run()
       at RedGate.SQLDataCompare.CommandLine.Startup._1(String[] )
    
    C:\Program Files\Red Gate SQL Bundle>
    
    izzyb
    0
  • Brian Donahue
    Hi Izzy,

    I'd conclude that the comparison key that you'd specified on one of the tables no longer exists. This probably wouldn't keep SQL Data Compare UI from being able to load the project because I'd imagine it probably compensates and automatically defaults to the primary key. Can you try loading the project into Data Compare (UI) and saving it again, then using it in the command-line version?
    Brian Donahue
    0
  • izzyb
    Looks good now. Thanks. :lol:
    izzyb
    0

Add comment

Please sign in to leave a comment.