| Author |
Message |
jmei
Joined: 03 Dec 2007 Posts: 4
|
Posted: Mon Dec 03, 2007 6:17 pm Post subject: Sychronize data for only a few of the database tables |
|
|
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. |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6348 Location: Red Gate Software
|
Posted: Mon Dec 03, 2007 6:28 pm Post subject: |
|
|
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
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
jmei
Joined: 03 Dec 2007 Posts: 4
|
Posted: Tue Dec 04, 2007 9:52 pm Post subject: Sychronize data for only a few of the database tables |
|
|
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. |
|
| Back to top |
|
 |
jmei
Joined: 03 Dec 2007 Posts: 4
|
Posted: Wed Dec 05, 2007 12:04 am Post subject: Sychronize data for only a few of the database tables |
|
|
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. |
|
| Back to top |
|
 |
|
|
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