Historical view

Applies to
ApexSQL Source Control

This article explains how to see database and single object history, and how to apply one of the previous versions of an object in ApexSQL Source Control.

Every source control system keeps track of the history of committed objects or object changes. In ApexSQL Source Control, the user can see that history and get any of the previous versions of an object without a need for third party clients.

There are two approaches to view history in ApexSQL Source Control:

  1. Project history – it can be accessed from linked database context menu in the Object Explorer pane:

    Project history

  2. Object history – it can be accessed from the context menu of the selected object in the Object Explorer pane:

    Object history

Both approaches use the same form:

Project history form

It shows every single object or batch commit as one changeset with its own version number. Changesets contain object(s) with an action that is performed (added, edited, and deleted).

The difference between those two approaches is that the Project history form shows all the changesets while the Object history form shows only changesets which contain the selected object (e.g. Person.Address). The Object history form shows changesets including all the containing objects, but the SQL script for other objects from the changeset is not available:

Object history form

The SQL script of a selected object from one changeset is shown on the right side of the Difference section. It can be compared with its state from any other changesets including database (current) version:

Changeset comparison

Clicking the Get button, specific version of an object can be applied showing the sequence, script and warnings (if any exist):

Get changes - script

Quick tip icon

Quick tip:

If the selected version of an object is the same as the one in a database, a notification message appears, saying that there is nothing to sync.

Historical view FAQs

Q: Can I apply all changes from a single changeset?

A: Currently, the Get operation can be performed only against a single object from the changeset.

Q: What is the difference between getting specific version from history and Get by label?

A: Getting specific version from history can be done only for single object at once, while the Get by label operation will apply all changes from selected label regardless on number of objects in it.

Q: Can I perform Get if some database development policy is active?

A: Depending on an active policy, the selected object must be checked out or locked before the Get operation is performed.

Q: If an object is checked out or locked by someone else, can I perform the Get operation and revert to one of the previous versions of an object?

A: If an object is locked by one user, other users cannot perform the Get operation. However, if an object is checked out, a notification message will inform the user that the object is checked out with an option to perform the Get operation or to cancel it. The user who locked an object can get any previous versions of an object and apply it.

Q: Does history stores all changes made on some database or only committed ones?

A: History stores only committed changes. To keep all changes made on a database in the shared development model, the Logging feature should be enabled.

Q: If I perform the Get operation, will the change be applied to both database and source control?

A: No, the change will be applied only on the database, and can be committed to the repository through the Action center tab.