Sdílet prostřednictvím


Managing Solutions with Source Control

After completing the previous topic, you have a solution called StatusCheck that you can manage with a source control product. The following practice reviews the basic operation of SQL Server Management Studio and Visual SourceSafe. Management Studio works with other source control providers, but to complete this practice as written, you must have Visual SourceSafe installed.

Using Visual SourceSafe with Solutions

To check a solution into Visual SourceSafe

  1. In Solution Explorer, right-click Solution 'StatusCheck' (1 project), and then click Add Solution to Source Control.

  2. In the Visual SourceSafe Login dialog box, complete the Username, Password, and Database text boxes, and then click OK.

  3. In the Add to SourceSafe Project dialog box, navigate to the folder where you wish to save the solution, and then click OK.

  4. You are asked if you wish to create the folder. Click Yes.

  5. In Management Studio, the Pending Checkins component is added to the display surface. If Pending Checkins was explicitly closed earlier, it may not display automatically. In that case, on the View menu, click Pending Checkins. Note that Pending Checkins has no information displayed in the body of the window: the solution was checked in when you added it, so there are no files currently checked out.

  6. Click in Query Editor, and add a new line and the word GO to the bottom of the script. Note that Pending Checkins automatically checks out the file and its containing solution and script project.

  7. Close the Pending Checkins component, as you might typically do to regain space in Management Studio.

  8. In Solution Explorer, right-click the Check Workorders.sql query, and then click View Pending Checkins. Pending Checkins appears again to remind you of the scripts you have modified, but not checked in.

  9. In Solution Explorer, right-click the Check Workorders.sql query, and then click Check In. The Check In dialog box opens. Select which items will be checked in, and add a comment describing your change.

  10. Click Check In to check in the files, and clear Pending Checkins.

Configuring Visual SourceSafe

Visual SourceSafe integrates well with Management Studio, but you can change your version control product and configure some of the features directly from Management Studio.

To configure Visual SourceSafe options

  1. On the Tools menu, click Options.

  2. Expand the Source Control node.

  3. Set the properties on each page of the node to support your working style.