Red Gate forums :: View topic - How to data sync heap tables (table w/o any pri/index keys)
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Compare 10
SQL Compare 10 forum

How to data sync heap tables (table w/o any pri/index keys)

Search in SQL Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
Philn



Joined: 01 Feb 2013
Posts: 7

PostPosted: Mon Apr 01, 2013 9:34 pm    Post subject: How to data sync heap tables (table w/o any pri/index keys) Reply with quote

Hi,
I need to sync tables that has no primary/index key using SQL Data Compare SDK. Is this possible in SDK?
Thanks in advance.
_________________
philn
Back to top
View user's profile Send private message
james.billings



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

PostPosted: Thu Apr 04, 2013 3:47 pm    Post subject: Reply with quote

Hi there, thanks for posting.

If the tables in question don't have any kind of key or unique index on them, you need to specify one (our engine needs to have *something* to compare on, else it doesn't know what should match up and what shouldn't).

Assuming you can determine a column (or combination of columns) that will uniquely identify rows in some way, then you can tell the tool to use this. In the GUI, it's a case of selecting the columns by going to the Tables & Views tab, then clicking in the first column for the given table.
In the SDK, you can do the same thing through the "MatchingMappings" collection. Have a look at the "TableMappingExample" in the SQLDataCompareSnippets example that's installed with the SDK for example usage.
Back to top
View user's profile Send private message
Philn



Joined: 01 Feb 2013
Posts: 7

PostPosted: Thu Apr 11, 2013 12:06 am    Post subject: Reply with quote

Hi James,
Thanks for the suggestions, I tried your suggestions - have not get it working yet, but will let you know the result.
Also I was able to work around this problem using MERGE statement, but it's mean I am not using the SDK. Sad
Thanks for your help James
_________________
philn
Back to top
View user's profile Send private message
james.billings



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

PostPosted: Thu Apr 11, 2013 1:10 pm    Post subject: Reply with quote

Sure thing, do post back if you need anything further!
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