Object reference not set to an instance of an object

Lee MellorLee Mellor Posts: 14
edited April 29, 2010 10:18AM in SQL Compare Previous Versions
hello,

i'm trying to create a snapshot of a database using sql compare 8 and i get the error 'Object reference not set to an instance of an object' as it tries to save. i've created snapshots from other databases on the same server and saved them to the same location without any issues. i can also use the database as a source in a comparison without problems. a dbcc check is run regularily on the database and returns no errors.

the log shows the following...

18:08:49.471|Info |Logging |1 |Current Logging levels enabled: Fatal,Error
18:09:35.500|Error |SQL Compare Engine |6 |Failed SaveToDisk
System.NullReferenceException: Object reference not set to an instance of an object.
at RedGate.SQLCompare.Engine.StoredProcedure.Serialize(NullableBinaryWriter writer)
at RedGate.SQLCompare.Engine.StoredProcedures.SerializeItem(StoredProcedure value, NullableBinaryWriter writer)
at RedGate.SQLCompare.Engine.SerializableCollection`1.a(NullableBinaryWriter )
at RedGate.SQLCompare.Engine.Database.a[a](NullableBinaryWriter , SerializableCollection`1 )
at RedGate.SQLCompare.Engine.Database.a(NullableBinaryWriter , Boolean , Boolean )
at RedGate.SQLCompare.Engine.Database.a(Stream , Boolean , Boolean )
at RedGate.SQLCompare.Engine.Database.a(String , Boolean , Boolean )

any suggestions would be gratefully received....

regards,

lee

Comments

  • Eddie DEddie D Posts: 1,803 Rose Gold 5
    Thank you for your post into the forum and sorry to hear that you experiencing a problem.

    How strange that you can compare the live database but not take a snapshot.

    Are you able to create the snapshot of this database if you specify another folder location on the same disk drive or to another folder located on a different disk?

    We have have a free utility called Red Gate Snapper, that can create a SQL Compare snapshot files without having to use SQL Compare.

    Red Gate Snapper can be downloaded using this LINK. Can you please download the utility and see if you can create a SQL Compare snapshot using Red Gate Snapper?

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
  • Hi Eddie,

    I dont actually run sql compare on the same server as the database. I run it locally on my machine. I've tried saving it to various locations both local and on network drives and still errors when attempting to save.
    I tried using sql snapper to create the snapshot and it works without any problems, even saving to the same location where it fails using sql compare.

    is there anything else you would recommend? am i able to use sql snapper with the command line?
  • further to this now using SQL snapper to create snapshots in a batch file it will work on some databases and not others when run on the same server. now i get an error stating the following;


    SQL Snapper V7.5.0.28
    ==============================================================================
    Copyright Copyright © Red Gate Software Ltd 2008

    Registering dellsan2032.DDD_IT_Production_Live
    Finished FAILED
    Unexpected error: An unexpected null value has been encountered while querying
    the database system tables. Please make sure that the database is in a
    consistent state by running DBCC CHECKDB. If the problem persists, please
    contact our support.
    An unexpected null value has been encountered while querying the database system
    tables. Please make sure that the database is in a consistent state by running
    DBCC CHECKDB. If the problem persists, please contact our support.
    RedGate.Shared.Utils.CommandLine.FatalExecutionException
    at RedGate.SQLCompare.SQLSnapper.SnapperCommandProcessor.Run()
    at RedGate.SQLCompare.SQLSnapper.Program.Main(String[] args)

    i've run dbcc on the database in question and it returns no errors. i've compared the database settings for the database that fails and one that works ok on the same server and they are all the same.

    any ideas?
Sign In or Register to comment.