Linking a Database to Perforce

Source Control is a Microsoft SQL Server Management Studio (SSMS) add-in that is designed to manage database changes in most well-known version control systems. With the help of the tool, you can version-control database schemas and data, roll back unwanted changes, handle static data conflicts, and maintain the integrity of the database. Source Control can help you link your database to Perforce, which is an enterprise version management system that handles shared file repositories, or depots. This version control system is especially fitting for large development teams and teams working on complex projects.

This topic explains how to link a database to Perforce (P4).

  1. In Object Explorer, right-click a database you want to link to source control.
  2. Point to Source Control, and then click Link database to source control… on the shortcut menu.

    Link DB to Source Control

    The Link Database To Source Control wizard opens.

  3. On the Link tab of the wizard, click ‘+’ in the Source control repository field.

    Link DB Wizard

    The Source Control Repository Properties dialog box opens.

  4. Select Perforce (P4) from the Source Control system drop-down list box.

    Link DB to Perforce

  5. In Source control settings, specify:

    5.1. P4Port, Username and Password for the Perforce server.

    5.2. Workspace. You can create a new workspace or select an existing one from the drop-down list box.

    >It is important to ensure that the Source Control feature of dbForge Source Control uses its own workspace for each database link.
    It is not recommended to use this workspace from other applications.

    To create a new workspace:

    • Click New in the Workspace section of Source control settings.
    • In the New Workspace dialog box, specify:
      • Name of the new workspace
        • an existing Depot
        • Path to the Folder with database scripts. Click ‘…‘ to select an existing folder or create a new one.

    New Workspace

    dbForge Source Control will work with scripts from this folder only. If you leave the Folder field empty, it will be considered that the whole depot contains database scripts. In this case, database scripts will be located in one of the Devart folders.

    To select an existing workspace:

    • Select an existing workspace from the drop-down list. Workspace also specifies the local folder where dbForge Source Control will store database scripts.
    • Optionally, select Mapping from the drop-down list box. Mapping specifies the depot and the remote folder, that will be used by dbForge Source Control.


    • Usage of existing workspace is not recommended due to possible conflicts with other applications or links.
    • For the correct work of the Source Control feature of dbForge Source Control, you and your colleagues must use identical settings for P4Port, Depot and Folder when configuring a new Workspace.
    • To get proper settings for** P4Port, **Username, Password and Depot, contact your system administrator.

    5.3. Repository name.

  6. Click OK to close the Source Control Repository Properties dialog box.
  7. Select a database development model. For more information, refer to the Database Development Models topic.
  8. Click Link. If a database is linked to source control successfully, a database icon in Object Explorer will be changed to show that a database is linked.

    Linked DB