How to avoid altering/dropping columns in target database?

Compares and synchronizes SQL Server databases, backups and scripts.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, eddie davis, Anu Deshpande, Michelle Taylor, alice.easey, james.billings, chengvoon.tong

How to avoid altering/dropping columns in target database?

Postby rdp2n » Wed May 29, 2013 8:32 pm

I'm just trying out SQL Compare, I've compared 2 DBs and would like to deploy. However:
Of those (N=461) "objects that exist in both but are different" I would like to avoid those updates where the target objects (e.g. columns) are dropped or modified. For example, in the bottom pane these appear with a red x next to them. How can I ensure that none of these are dropped in the deployment?

-- Thanks, Rob
rdp2n
 
Posts: 2
Joined: Wed May 29, 2013 8:18 pm

Postby Brian Donahue » Mon Jun 03, 2013 10:34 am

Hi Rob,

This looks pretty easy to do - just group objects by their status (only in 1/different/only in 2) and check the checkbox in the header of the objects that only exist in database 2 so that all of those objects are deselected. Then use the deployment wizard to synchronize the selected objects. That should stop and objects from being dropped.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby rdp2n » Thu Mar 13, 2014 4:27 pm

Hmmm...
In our case, though we want to transfer all the changes from the source to the target WITHOUT DROPPING anything from the target -- just adding in our modificiations. For example, we have scores of tables which exist in both source and target, that have columns from the source that we want to add to the target. However, on those same tables we have columns in the target that don't exist in the source that we want preserved. These are marked with a red x and I can't see a convenient way to exclude these from being dropped in the deployment (other than writing a perl program to edit out the DROPs in the deployment script??).

So, for this application, we don't want a perfect DB synchronization source<->target -- what we need is to leave the target structure essentially untouched, just adding/inserting any objects (i.e. table columns) that exist in the source but not in the target. When it comes to the tables it seems to me that it's an all or nothing proposition. I can't see how to prevent target columns from being dropped whether using Tools->Options, or custom filters/rules.

So I'm stumped -- can anyone suggest what I might be missing?

Thanks,


Rob
rdp2n
 
Posts: 2
Joined: Wed May 29, 2013 8:18 pm


Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 0 guests