How do I set up a custom comparison key with the API
jw970170
Posts: 16
Hi,
I need to set up a custom comparison key with the API but I can't figure out how to do it? Any ideas?
I need to set up a custom comparison key with the API but I can't figure out how to do it? Any ideas?
Comments
Have a look at this forum thread...
http://www.red-gate.com/MessageBoard/vi ... php?t=4078
HTH
Project Manager
Red Gate Software Ltd
I set up the table with the custom mapping so that one of the rows in one database had an update in it. This update was detected in the differencesummary. I set the SqlSynchronization to Update and Add and then proceded to first update the master db from the local, and then update the local from the master (so new rows in both databases are added to each respective database)
block = provider.GetMigrationSQL(session, true);
executor.ExecuteBlock(block, MasterServer, MasterDatabase, false, MasterUserName, MasterPassword);
block2 = provider.GetMigrationSQL(session, false);
executor.ExecuteBlock(block2, ClientServer, ClientDatabase, false, ClientUserName, ClientPassword);
The problem is, the update is not happening. Each time it says synchronization is complete and yet the table does not get updated and the difference summery always shows 1 difference. When I do it from the desktop tool, it updates properly. Any idea what is wrong? There is binary data in the table
If the expected update statements don't appear for the table, you may want to check the status property of the table's mapping right after calling RefreshMappingStatus. There may be a problem matching the RoadSectionsID column as a suitable primary key.
Thanks for your help.