Red Gate forums :: View topic - Order of tables in synchronization script (data compare)
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Comparison SDK Previous Versions
SQL Comparison SDK Previous Versions forum

Order of tables in synchronization script (data compare)

Search in SQL Comparison SDK Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
Janez



Joined: 05 Jan 2007
Posts: 12
Location: Celje, Slovenia

PostPosted: Tue Feb 28, 2012 11:03 am    Post subject: Order of tables in synchronization script (data compare) Reply with quote

Hi,

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?

Thanks
Janez
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1123
Location: My desk.

PostPosted: Wed Feb 29, 2012 5:05 pm    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic 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