Red Gate forums :: View topic - Compare Snapshot to Database
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Comparison SDK Previous Versions
SQL Comparison SDK Previous Versions forum

Compare Snapshot to Database

Search in SQL Comparison SDK Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
wkhazzard



Joined: 08 Mar 2011
Posts: 12
Location: Mid-Atlantic USA

PostPosted: Tue Mar 15, 2011 7:17 pm    Post subject: Compare Snapshot to Database Reply with quote

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
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1144
Location: My desk.

PostPosted: Wed Mar 16, 2011 8:52 pm    Post subject: Reply with quote

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:

Code:
Database productionDB = new Database();
productionDB.LoadFromDisk(@"c:\snapshots\MySnapshot.snp");
Back to top
View user's profile Send private message
wkhazzard



Joined: 08 Mar 2011
Posts: 12
Location: Mid-Atlantic USA

PostPosted: Fri Mar 18, 2011 3:56 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1144
Location: My desk.

PostPosted: Wed Mar 23, 2011 9:11 pm    Post subject: Reply with quote

No, it took me a little while to find that one too! Glad it's working.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group