Source Code Management and Database Deployment - Administering the Visual SourceSafe Database
(Page 2 of 9 )
Before you can use Visual SourceSafe, you need to create users and assign privileges to them.
When you install Visual SourceSafe, you create just two users: Admin and Guest. The Admin user has all privileges in the database and can also create other users. The Guest user is initially limited to read-only access to source code files. Both users are created with their password set to an empty string (that is, blank). Since this state constitutes a threat to your source code, your first step should be to set the Admin password using Visual SourceSafe Administrator (User | Change Password). When you are done, create a user for yourself (Users | Add User) with the appropriate permissions.
TIP
If your Visual SourceSafe username and password match your operating system username and password, you will not have to type them each time you open Visual SourceSafe on the local system. Visual SourceSafe can be configured to use them automatically.
With Visual SourceSafe, you can assign more refined permission levels, such as Add, Rename, Delete, Check In, Check Out, Destroy, and Read. To activate this wide-ranging control, click Tools | Options | Project Security and check the Enable Project Security option.
Adding Database Objects to Visual SourceSafe in Visual Studio .NET To demonstrate the implementation of source code control in a database project, you add code from your sample Asset database in Visual Studio .NET:
- Create the Asset database project in Visual Studio .NET.
- Open Solution Explorer.
Make sure that the Asset database is one of the Database References. If the reference does not already exist, right-click Database References and select New Database Reference to create one that points to the Asset database.

Figure 11-1. The Generate Create Scripts dialog box
- In the Server Explorer, expand the Data Connections node.
- Right-click the Asset data connection and choose Generate Create Script. The program prompts you for objects to be scripted (see Figure 11-1 above).
- Select Script All Objects, and then switch to the Options tab and select the Script Database, Script Object-level Permissions, Windows Text (ANSI), and Create One File per Object options.
- When the program prompts for the folder, accept …\Asset\Change Scripts. The program will then create a set of script files for the database objects (see Figure 11-2).
Select File | Source Control | Add Solution to Source Control. Visual Studio .NET will prompt you to log in to the Visual SourceSafe Common database:

Figure 11-2. Crate scripts
If your Visual SourceSafe database is stored locally, you can keep the Common database. If your Visual SourceSafe database is not stored locally, use the Browse button to locate the shared srcsafe.ini file.
NOTE
On my machine, the Visual SourceSafe database is located in the C:\Program Files\Microsoft Visual Studio\Common\VSS folder. My computer, in this case, is a development workstation, as well as the database server and Visual SourceSafe server.
If the Visual SourceSafe client is installed on the same machine as SQL Server, the location of the Visual SourceSafe database that you need to specify in this text box should be relative to the server machine. If you are developing from a workstation that is separate from the “development” server, you have to be careful how you enter the location of the Visual SourceSafe database. You should use the server’s absolute path (for example: C:\Program Files\Microsoft Visual Studio\Common\VSS) regardless of whether you have that drive mapped on your workstation using another drive letter (such as S:).
- Visual SourceSafe prompts you to add a project to Visual SourceSafe. Name the project (you can also type a comment to describe the project).
Visual SourceSafe creates a project and locks all Create scripts (scripts that can be used to drop and create objects from scratch). You can see a small lock icon beside each Create script in Solution Explorer:

NOTE
From this moment, you must check out a Create script before you can change it.
Next: Managing Create Scripts in Visual Studio .NET >>
More MS SQL Server Articles
More By McGraw-Hill/Osborne
|
This article is excerpted from SQL Server 2000 Stored Procedure & XML Programming, second edition, written by Dejan Sunderic (McGraw-Hill/Osborne, 2004; ISBN: 0072228962). Check it out at your favorite bookstore today. Buy this book now.
|
|