Order of tables in synchronization script (data compare)

Automate and integrate using the SQL comparison API

Order of tables in synchronization script (data compare)

Postby Janez » Tue Feb 28, 2012 11:03 am


I am using SQL Comparison SDK for data compare (assembly version 8.5). Account (SQL authentication) that will be used to connect to both databases (source and target) will have db_owner rights in the source database, but it will only be member of db_datareader and db_datawriter roles in the target database (security policy does not allow anything else for the target database). Because of this, I suppose it will not be possible to use option to disable foreign keys in the target database before the sync. Here is my question:
Does Comparison SDK generate sync script according to the order of tables in the target database based on the relations between them?
For example, if I have Customer and Order table, will it always generate INSERT statements for Customer first and then Order and vice-versa with DELETE statements?

Posts: 12
Joined: Fri Jan 05, 2007 10:21 pm
Location: Celje, Slovenia

Postby james.billings » Wed Feb 29, 2012 5:05 pm

Thanks for your post - you may have trouble unfortunately. There's no easy way to control the ordering in the way you suggest, as our sync scripts are designed to work by disabling all FK's first, inserting/updating/deleting as appropriate, then re-enabling again.

If you can work out a correct order to do things that satisfies the keys then potentially you could work with one table at a time; but it's likely to get a bit messy...
Posts: 1121
Joined: Wed Jun 16, 2010 11:10 am
Location: Red Gate

Return to SQL Comparison SDK Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests