Options

Insert and updates with excluded Columns

prabhubravoprabhubravo Posts: 7
edited September 17, 2014 9:53AM in SQL Compare Previous Versions
Hi There,
A have a set of config tables with have that have certain columns excluded for comparison. While generating the update and insert scripts for these tables, the tool generated scripts
1) For row updates (where columns being compared has some differences) the scripts generated, overrides the value that exist in the target database (null_value)
2) For inserts, the value is null.

Can I have an option to reverse this i.e.
1) For inserts, I want the value from the source to be inserted into the target database.
2) For updates, the excluded columns should not be touched.

Also, is there are option for the updates to 'set' only the columns that are changed. Say a table T has columns a, b and c. Key is a and columns compared are b &c. If column b is different in source and target dbs, then I would expect the scripts to update only column b and not c.

Thanks,
Prabhu.

Ministry of Social Development,
New Zealand.

Comments

  • Options
    Hello,

    Just trying to work out what the issue is - if I had to sum it up in one sentence, would this be accurate?

    I would like SQL Data Compare to not script data for a column of a row when there is no difference in that particular column in that particular row.

    Assuming that you actually did not go into the mappings and exclude that column from being compared - in that case the update statement should not include that column at all. You can exclude a column from a comparison like this:
    http://documentation.red-gate.com/displ ... +and+views
Sign In or Register to comment.