Sychronize data for only a few of the database tables

Forum for users of SQL Toolkit 3,4,and 5

Sychronize data for only a few of the database tables

Postby jmei » Mon Dec 03, 2007 6:17 pm

Hi,

I am trying to use API to synchronize table data for only a few of the database tables.

I set the RefreshSelected property to true on the TableDifference objects for those tables I want to sychronize, and set to false for other tables I don't want to sychronize. But when I generate the block using SqlProvider.GetMigrationSQL, the data in all tables in the database are synchronized.

I only want to sychronize data for a few tables in the database. How can I complete this task?

Thanks


J.
jmei
 
Posts: 4
Joined: Mon Dec 03, 2007 5:53 pm

Postby Brian Donahue » Mon Dec 03, 2007 6:28 pm

Hi J,

It's possible to select a subset of tables to compare and synchronize by looping through the automatically-generated table mappings (created with the CreateMappings method in the sample code) and setting each mapping's 'Include' property to true or false depending on whether or not the mapped tables or views should be synchronized.

You can see an example here.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Sychronize data for only a few of the database tables

Postby jmei » Tue Dec 04, 2007 9:52 pm

Hi Brian,

Thank your for your response.

It seems that the include proporty for mappings does not work for me. I nodified my code, and set the include property to true for those tables I want to synchronize and to false to those tables I don't want to sychronize. I traced the run, the include properties were set correctly as what I wanted, but all tables were still synchronized. The block had script all table data.

Any thing I missed?

Thank you.


J.
jmei
 
Posts: 4
Joined: Mon Dec 03, 2007 5:53 pm

Sychronize data for only a few of the database tables

Postby jmei » Wed Dec 05, 2007 12:04 am

Hi Brian,

I have solved the problem. I set the include property after the CompareSession, incorrectly. I have fixed it. And it worked.

Thanks,


J.
jmei
 
Posts: 4
Joined: Mon Dec 03, 2007 5:53 pm


Return to SQL Toolkit Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests