Sychronize data for only a few of the database tables

jmeijmei Posts: 6
edited December 4, 2007 6:04PM in SQL Toolkit Previous Versions
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.

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 New member
    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.
  • 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.
  • 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.
Sign In or Register to comment.