IgnoreColumns only for existing rows?
LittleColin
Posts: 16
Is it possible to ignore a certain column but only where a data row already exists?
For example, we create scripts during development with some basic data that can be customised in production. We don't want to overwrite the production data changes with our development values but if the row doesn't exist then we want to populate it with an initial value.
For example, we create scripts during development with some basic data that can be customised in production. We don't want to overwrite the production data changes with our development values but if the row doesn't exist then we want to populate it with an initial value.
Comments
I think I've solved this by doing a two step script generation.
1. Use /include:Missing to add any additional rows introduced in Dev and carry across all columns.
2. Use /include:Differences /ignoreColumns:MyProductionMasterColumn to carry across updates without affecting columns that are edited in production.
http://www.cybercohesion.com
1. Synchronise basic static data (only managed in development)
2. Add any missing row data (/include:Missing)
3. Add any column updates where the columns are not managed in production (using /ignoreColumns)
However if data is added in step 1 that is dependent on the missing rows added in step 2 then it fails. If I move step 1 to after step 2 then I have the same dependency issue but the other way around. Ideally I need to be able to run all of the above in a single go and let RedGate figure out the dependencies.
Is it likely that this can be done via the API?
http://www.cybercohesion.com
However, the problems you raise in your third post are not to do with dependencies - as Data Compare ignores them (FK, constraints, ref. integrity are disabled before and then re-enabled after the script is run)- but I think the failures are simply that the database is being updated at the same time. In which case the only recommendation is to run the script at a quieter time. Data Compare is good but not quite that good, yet