What are the challenges you face when working across database platforms? Take the survey
Options

how to only compare updates and inserts

b16b18b16b18 Posts: 3
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?

Comments

  • Options
    i think this will do it, can someone confirm?

    session.CompareDatabases(db1, db2, mappings, SessionSettings.IncludeDifferentRecords And SessionSettings.IncludeRecordsInOne)
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    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.
    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.
Sign In or Register to comment.