SQL Source Control - 2.2

SQL Source Control

Learning SQL Source Control - 2.2

Conflicts

Conflicts occur when the latest version of an object in source control and the latest version in the database are incompatible. Conflicted objects cannot be committed or retrieved until the conflict has been resolved.

This happens if two people modify the same object.

When a conflict occurs, the Conflict to resolve bar is displayed in the Object Differences pane:

To resolve a conflict, choose either:

  • Keep mine

    Your changes are committed to source control.

    This replaces any changes to the latest source control version that are not present in your database version.

    Or

  • Take theirs

    Your changes are discarded, and the database is updated to the latest source control version.

Merging

Note that merging is not currently supported.

To merge changes from two conflicting versions of an object, resolve the conflict, and then manually edit the object to include the changes from the other version.

To make this easier, you can copy either version of an object's creation script from the Object Differences pane, and paste it into a new query window.

To avoid conflicts, you are recommended always to get the latest version of an object before modifying it.

Conflicts involving data

If an object has both schema and data changes, you must commit or get the latest schema and data changes at the same time. You cannot commit only the data changes. This is because data changes may fail without the associated schema changes.

So if an unconflicted data change is associated with a conflicted object, you cannot commit or get the data change without first resolving the schema conflict.

See also

Linking a database to source control

Committing changes

Source controlling data

Getting the latest version

Viewing source control logs / history

Getting a specific version

Deploying a database from source control

Undoing changes

Using SVN bug IDs & TFS work items

Working with config files

Using filters to exclude objects

Branching and merging

Was this article helpful?

Search support
Forums

SQL Source Control

all SQL products

all products