Sync data using project file setting
kkchan
Posts: 33
Hi,
I am using Data Compare to configure tables mappings, table to be sync, options, PK and etc. All of these settings are saved in Data compare project file.
How could I use SQL toolkit to sync database which will follow my settings saved in project file?
Thank you
I am using Data Compare to configure tables mappings, table to be sync, options, PK and etc. All of these settings are saved in Data compare project file.
How could I use SQL toolkit to sync database which will follow my settings saved in project file?
Thank you
Comments
Project Manager
Red Gate Software Ltd
What do you meant by default schema? How to create it?
Since I already have set what tables to be sync, can I just use those tables? How to do this?
Thank you
Project Manager
Red Gate Software Ltd
What does ReplayUserActions method do?
After call ReplayUserActions(), do I need to add code to create comparisonsession, comparedatabase, execute block and etc?
Thank you
Make a few changes in the UI save the project and open it in an XML editor and you'll see what I mean.
Project Manager
Red Gate Software Ltd
I have code as below. Is it correct?
After you created your SchemaMappings and ran ReplayUserActions you were done. CompareDatabases has multiple overrides and will take the SchemaMappings directly. What you've done is effectively created a replacement table mappings without all the project settings applied and used that instead.
HTH
Project Manager
Red Gate Software Ltd
Thank you for reply.
What about sync, comparison and mapping behavior? Anyway to "load" from project file?
I have a common method to do sync. I only pass project name to it and it would load project and do the rest. That why I don't have to have seperate code to manage it since already defined inside project file
Please advice.
Thank you
Pass routine Project File...
Load Project File
Get Databases as described in project file
Set options as in project file
Create SchemaMappings
ApplyUserActions to SchemaMappings from project file
Perform comparison
Perform synchronisation
Job Done
Project Manager
Red Gate Software Ltd
How could I know what options set in project file?[/quote]
Project Manager
Red Gate Software Ltd