Reducing registration overhead

alexstyleralexstyler Posts: 22
edited July 11, 2007 4:37AM in SQL Toolkit Previous Versions
Hi, I'm using the toolkit in a new project to compare a database with it's snapshot (a database identical in structure when taken).

I know that the databases are identical and I'm only interested in data differences. Is there any way to reduce the overhead associated with RegisterForDataCompare if I know the structure is identical and I'm only interested in the data?

I attempted enabling almost every ignore option possible, but a trace shows that you still query the server for the same information, presumably ignoring it on your end instead of not retrieving it to begin with.

Thanks,
Alex

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi Alex,

    I can't get a Data Compare to work without using the RegisterForDataCompare call first. Loading a snapshot saved with SQL Compare and comparing it to a database registered for data compare always results in a null-reference exception, so I'd have to say that using the RegisterForDataCompare method is mandatory.
  • Let me clarify,

    I'm comparing a database with a "database snapshot" created by SQLServer 2005. These snapshots act as exact, read-only replicas of the original database when the snapshot was taken. They are stored as diffs of the original database, so the initial act of creating a snapshot is almost instantaneous.

    I'm taking a snapshot, applying some modifications, then using DataCompare to verify the database behaves as expected. That is, certain operations yield the same effects on a database time after time.

    My question was: are there any ways to reduce the overhead of RegisterForDataCompare? It takes some options, which don't seem to affect its number of roundtrips to the database.

    In my situation, I only care about data, no triggers, schema, or functional comparisons; I know the structures of the databases will be identical.

    I've done some more testing and indeed I cannot reduce the overhead. I moved towards registering once and handling the effects myself.

    Thanks for your effort and response. Perhaps in a future version of the toolkit you may consider adding more options to the registration and only query the databases for the data you need.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi Alex,

    There is a bit of ambiguous terminology going on here, so I apologise for any confusion. SQL Compare can save a structured file representation of your database schema, which is also called a snapshot. My thinking was that you could get around having to use RegisterForDataCompare by loading the snapshot file from disk using the database.loadfromdisk method. What I found was that this doesn't work for DataCompare.Engine.

    I don't know of any way to speed up RegisterForDataCompare.
Sign In or Register to comment.