Compare Snapshot to Database

I am trying to compare a snapshot to a database using the SQL Compare SDK. I have looked at all the samples and combed through the object model. I can't figure out how to get a SnapshotSource object to behave as a Database object or vice versa. Nor can I find a CompareWith method on the database class that accepts a SnapshotSource or an IDataSource. Is there a sample floating about at Red Gate that shows how to compare a snapshot with a database in the same way that the stand-alone SQL Compare tool does this?

Thanks,
Kevin Hazzard, C# MVP & Friend of Red Gate
http://devjourney.com

Comments

  • James BJames B Posts: 1,124 Silver 4
    Thanks for your post. I think the snapshotsource is more for creating the snapshots.

    If you set it up to work with two Database objects, you should be able to use the "LoadFromDisk" method on one of them to load a snapshot file, i.e:
    Database productionDB = new Database();
    productionDB.LoadFromDisk(@"c:\snapshots\MySnapshot.snp");
    
    Systems Software Engineer

    Redgate Software

  • Thanks, James. Worked like a charm. The LoadFromDisk method name just didn't jump out as the correct way to load a snapshot.

    Cheers,
    Kevin Hazzard, C# MVP & Friend of Red Gate
    http://devjourney.com
  • James BJames B Posts: 1,124 Silver 4
    No, it took me a little while to find that one too! Glad it's working.
    Systems Software Engineer

    Redgate Software

Sign In or Register to comment.