Red Gate forums :: View topic - Simple Example Needed: Sync just one record from one table
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

Simple Example Needed: Sync just one record from one table

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



Joined: 18 Jun 2009
Posts: 16

PostPosted: Mon Oct 26, 2009 3:31 pm    Post subject: Simple Example Needed: Sync just one record from one table Reply with quote

Hello,

I need a simple vb.net example... I just want to sync one record from one table. All of the examples I've looked at loop through all mappings conditionally setting the desired tables' include property to True, and all the others to False, but is that really neccessary?

Isn't there some simple way to say:

1. Include just this one table (without looping) and disregard all other tables
2. Filter to just this one record (id=172)
3. If the records exist in db1 and db2 then sync them.

If I set this up in Sql Data Compare 8, this works PERFECTLY. Why does this seem so difficult in the SDK?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6643

PostPosted: Tue Oct 27, 2009 5:09 pm    Post subject: Reply with quote

Hi Jon,

Thanks for your question. I suppose you have two approaches that you can use -- one would be to create the mappings automatically, loop through all matching mappings, and set the "Included" property to false on all of them except the table or view that you want to compare.

The other mapping approach would be to manually construct a table mapping in code and then add it to a manually-constructed TableMappings collection.

To compare a subset of data, you can apply a "WhereClause" to the mapping to limit the data to the records that you want to compare and synchronize. There are many ways to filter the data in either the comparison or synchronization processes.
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