Red Gate forums :: View topic - how to only compare updates and inserts
Return to www.red-gate.com RSS Feed Available

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

how to only compare updates and inserts

Search in SQL Comparison SDK 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
b16b18



Joined: 11 Jan 2014
Posts: 2

PostPosted: Sat Jan 11, 2014 7:36 am    Post subject: how to only compare updates and inserts Reply with quote

i want to do the equivalent of unchecking Target only for each table in SQL Data Compare which removes deleting records from the destination. I only want to deploy updates and inserts to the destination db. I've done this before with SDK 8 but I don't have access to the code I used anymore. What options do I set?
Back to top
View user's profile Send private message
b16b18



Joined: 11 Jan 2014
Posts: 2

PostPosted: Sat Jan 11, 2014 6:58 pm    Post subject: Reply with quote

i think this will do it, can someone confirm?

session.CompareDatabases(db1, db2, mappings, SessionSettings.IncludeDifferentRecords And SessionSettings.IncludeRecordsInOne)
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6677

PostPosted: Mon Jan 13, 2014 3:39 pm    Post subject: Reply with quote

The current release of SDK uses an enum to specify the options, so to bind them together, you would use a bitwise or operation, or just plain "Or" in Visual Basic.
Code:
session.CompareDatabases(db1, db2, mappings, SessionSettings.IncludeDifferentRecords Or SessionSettings.IncludeRecordsInOne)
This will compare and synchronize records in database 1 (the left database) and the different records that exist in both databases. Since it's ignoring records that only exist in database 2 (the right database), DELETEs should not be scripted.
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