Adding Source Control to a Database Project

You can maintain control over a database and its structure by adding your database project files to source control. Database projects consist of folders and SQL script files. Once you've placed these folders and files under source control, you can manage these folders and files, just as you do with the folders and files in Web projects. For information on how to use source control with folders and files, see Working with Multiple Developers.

Note   When you add folders and files to a database project, they are physically added to your hard disk. In addition, when you put a database project under source control, there is a one-to-one correspondence between the files and folders in the database project and the files and folders in the source control project.

You can also rename a data connection in a database project. Because connections are represented as folders on your hard disk and in the source control project, this will also rename those folders.

To add a database project to source control

  1. In Project Explorer, select the database project.

  2. Right-click the database project name, and from the shortcut menu, choose Add to Source Control.

    The database project and its files are now under source control.

    If you want to remove them from source control later, you can use the Remove from Source Control command on the shortcut menu.

In the Data View window, you can put stored procedures under source control. This gives you additional control over these database objects. In a database project, a stored procedure might be contained in an SQL script; for Web projects they appear in Data View as stored procedures. For more information, see Managing Databases in Data View.

If you are working locally, databases on a Web server or database server are available. However, if you are offline, you must have the database on your local computer. There's no way to merge any changes you make to the data while you are offline in Microsoft® Visual InterDev™.