Archive for the 'SourceSafe' Category

Jan 12 2009

How to version control SQL Server Stored Procedures using SourceSafe and Visual Studio 2003

Published by Kevin Gao under SourceSafe

This article is a part of SourceSafe / VSS Tutorial

SQL Server stored procedures can be added to Visual SourceSafe (VSS) for version control by using the source control feature in Visual Studio .NET 2003.

 

To add SQL Server stored procedures to VSS, please follow the steps below:

1. Verify that SQL Server is running under a domain account and the current log on user of SQL Server has read & write rights to the VSS Database folder. We can check this by right-clicking My Computer, and then clicking Manage -> Services and Applications -> Services. In the service list, right-click MSSQLSEVER and click Properties -> Log On tab.

SQL Server Log On user
(SQL Server Log On user)

 

2. Install Visual SourceSafe on the SQL Server machine.

3. Install Visual Studio .NET server components on the computer running SQL Server. During the installation, please check the VS 6 Stored Procedure Version Control option under Server Components.

Visual Studio .net 2003 Setup
(Visual Studio .net 2003 Setup)

 

4. Start Visual Studio .NET, click menu Tools -> Options -> Database Tools -> Server Explorer, and check Enable version control under Stored Procedures.

Enable Version Control
(Enable Version Control)

 

5. Open the Server Explorer pane by clicking menu View -> Server Explorer, and then expand to the Stored Procedures folder.

6. Right-click the Stored Procedures folder, and click Add to Source Control.

Add to Source Control
(Add to Source Control)

 

7. The Enable Source Control dialog box prompts out. We need to input the VSS database location and project name here. Please note that we do not need to use the “$/” prefix in the Source Control Project Name text box. Visual Studio .NET adds “$/” automatically. For example, if the project name in VSS database is “sql_2000″, we should input “sql_2000″ rather than “$/sql_2000″.

Enable Source Control
(Enable Source Control)

 

8. In the Source Control Login dialog box, type the VSS Login ID and the Password, and then click OK.

Source Control Login
(Source Control Login)

 

9. We can now add stored procedures into source control of SourceSafe by right-clicking on the stored procedure files and selecting Add to Source Control. There will be lock icons on the left side of the stored procedure files denoting the files are in source control, as shown in the following screenshot:

Lock Icon
(Lock Icon)

 

And we will see the stored procedure files in SourceSafe Explorer:

VSS Explorer
(VSS Explorer)

 

10. After all the steps above were done, we will be able to find the SourceSafe options by right-clicking the stored procedure files in the Server Explorer pane.

Source Control Operations
(Source Control Operations)

 

For information on how to source control SQL Server objects in SQL Server Management Studio 2005/2008, please refer to my other articles: Integrating SourceSafe / VSS with SQL Server 2005 and Integrating SourceSafe / VSS with SQL Server 2008.

 

SourceAnywhere - the SQL Server-based SourceSafe Replacement The SQL Server-based Source Control Software Designed to be a SourceSafe Replacement SourceAnywhere for VSS - the Fastest SourceSafe Remote Access Tool Recommended by Microsoft The Fastest SourceSafe Remote Access Tool Recommeded by Microsoft

Links:
Previous article <<<<:
Next article >>>>:
SourceSafe How To series home page: VSS / SourceSafe Tutorial

One response so far

Dec 22 2008

How to Manage Security in SourceSafe / VSS

Published by Kevin Gao under SourceSafe

This article is a part of SourceSafe / VSS Tutorial

Introduction

SourceSafe provides a tool, Visual SourceSafe Administrator, to manage the permission of the VSS users.

However, designed for trusted environment, SourceSafe offers very low security. Regardless of the VSS project level permission, all VSS users must have read & write permission of the whole VSS folder from the file system. This means even for a VSS user who only has read permission of a single file in VSS database, he/she can copy or even delete the whole VSS database from the file system

Furthermore, if we have remote SourceSafe users, we need to expose our whole VSS database folder from the file system level, which makes our source code vulnerable to outside hackers.

There is no easy way to solve this security vulnerability since VSS is designed that way. One possible option is to use an add-on tool to convert VSS from a file based system to a client/server architecture based system. A tool I developed, called SourceAnywhere for VSS, can do this job. The link for SourceAnywhere for VSS is:
http://www.dynamsoft.com/Products/SAW_Overview.aspx

The project level security mechanism in VSS can only prevent unintended changes. If you are still interested in learning more about how to set the project level securities in VSS, you can read more about it below. :)

 

Managing project level security

To manage the project rights for an individual command for each user, we can follow the steps below:

1. Open Visual SourceSafe Administrator program.

2. Check the Enable Rights and Assignments commands box in the Visual SourceSafe Administrator menu Tools -> Options -> Project Rights tab. In the New User Rights area of the Project Rights tab, we can deselect the project rights that do not apply to any database users.

SourceSafe Options
(SourceSafe Options)

 

3. Now there are 3 rights commands available on the Tools menu: Rights by Project, Rights Assignments for User and Copy User Rights.

 

To assign project rights from the project list:

1. In Visual SourceSafe Administrator, click Tools -> Rights by Project.

2. In the Project Rights dialog box, select a project and click Add User to attach the user for whom to assign project rights.

Project Rights
(Project Rights)

 

3. Select a user in the user list. Under User rights, specify the permissions.

 

To assign project rights from the user list:

1. In Visual SourceSafe Administrator, select a user in the users list, and click Tool -> Rights Assignments for User.

2. In the Assignments for dialog box, click Add Assignment.

Assignments for <user>
(Assignments for )

 

3. Select a Visual SourceSafe project and then specify permissions for the user on the selected project. Please be advised that a user must have the Destroy project right to deploy a Web site.

Add Assignment for <user>
(Add Assignment for )

 

To copy one’s user rights to another user:

1. In Visual SourceSafe Administrator, click the user whose project rights you want to modify in the users list.

2. Click menu Tools -> Copy User Rights. The Copy Rights Assignments to dialog box prompts out.

Copy Rights Assignment to Test
(Copy Rights Assignment to Test)

3. Select a user from whom to copy rights, and then click Copy.

 

SourceAnywhere - the SQL Server-based SourceSafe Replacement The SQL Server-based Source Control Software Designed to be a SourceSafe Replacement SourceAnywhere for VSS - the Fastest SourceSafe Remote Access Tool Recommended by Microsoft The Fastest SourceSafe Remote Access Tool Recommeded by Microsoft

Links:
Previous article <<<<: How to manage users in SourceSafe / VSS
Next article >>>>:
SourceSafe How To series home page: VSS / SourceSafe Tutorial

No responses yet

Dec 19 2008

Show History in SourceSafe / VSS

Published by Kevin Gao under SourceSafe

This article is a part of SourceSafe / VSS Tutorial

Show History Basics

Show History is one of the most important features in SourceSafe. My personal feeling is that being able to go back to the pervious versions is the main purpose that software development teams use version control tools. It gives us peace of mind when we implement new features and fix bugs.

The Show History command in SourceSafe allows us to view the history information of a file/project by listing all the versions of an item from the latest version to the creation of the item. In the History Explorer, we can see the version number of the item, the user who performed the action, the date/time of the event and the action. We can also perform operations like Get, View, Pin on a specific version of the item and rollback a file to an old version.

Many developers only use the History Explorer to view a previous version or do diff and may not know many useful features of the History Explorer. I am listing some of the features in the following section and hope you will find it useful.

 

How to view the history of an item

To view history of a file/project, we can click Show History under the Tools menu or from the right-click menu of the item, set history options in the following dialog box and then the history explorer will appear listing all the historical information of the item.

 

History Explorer

File History Explorer
(File History Explorer)

 

Get an old version of a file/project

Sometimes we may want to retrieve an old version of a file or project. We can do that through history explorer. Select the version of the file/project we would like to retrieve and click Get.

Get a version of a file/project by label

Label is a good way to manage version release/builds. For more information, see Label. VSS also provides the feature to get an item by label. If we check Include Labels option in the History Options dialog box, we will see all the labels that have been assigned to the item in the Action column of history explorer. Simply selecting the labeled version and clicking Get will get the labeled version to the local drive.

Diff two versions of a file

In history explorer, we can also compare two versions of a file. To do that, we can select two versions of the file and click Diff. For more information, see File Diff.

Pin an old version of a file

If we want our team members to get a specific historical version of a file by default, we can pin the file to that version by selecting the version in the history explorer, and clicking Pin. For more information, see Pin.

Rollback to an old version of a file

We can use the Rollback feature to return a file to an old version and erase all the newer versions . If the file is shared among several projects, Rollback will only affect the current project. It breaks the file in the current project from that in the other projects. To rollback to an old version, we can select the version we want to rollback to and click Rollback in the history explorer.

Change label & comment

We may want to change the label/comment of an item in some situations. We can do it through history explorer too. Select the item version from the history explorer, click the Details button and then we can change label and comment in the History Details dialog box.

History Details
(History Details)

 

History report

We can report the history information of an item to a printer, file or clipboard by clicking Report button in the history explorer. Checking Include details can include more detailed information, like comments in the report. Checking Include differences can include the differences between versions in the report.

History Report
(History Report)

 

Share an old version of project

In the project history explorer, we can select a version of the project and click Share to share this version of the project with other project.

Project History Explorer
(Project History Explorer)

 

History Share
(History Share)

 

SourceAnywhere - the SQL Server-based SourceSafe Replacement The SQL Server-based Source Control Software Designed to be a SourceSafe Replacement SourceAnywhere for VSS - the Fastest SourceSafe Remote Access Tool Recommended by Microsoft The Fastest SourceSafe Remote Access Tool Recommeded by Microsoft

Links:
Previous article <<<<: Pin in SourceSafe / VSS
Next article >>>>:
SourceSafe How To series home page: VSS / SourceSafe Tutorial

No responses yet

Nov 27 2008

Pin in SourceSafe / VSS

Published by Kevin Gao under SourceSafe

This article is a part of SourceSafe / VSS Tutorial

Pin is a small but sometimes helpful feature in Visual SourceSafe (VSS). VSS defines Pin as a marker that designates a specific version of a file. For example, if we want our team members to get a historical version by default, we can pin the file to the specific version.

Pin is not a native feature in SourceSafe. I usually do not use Pin very often and my personal recommendation is that we should avoid Pin if possible.

 

Pin has the following features:

  • When we do Get Latest, for a pinned file, VSS retrieves the pinned version, not the latest version.
  • We can still get the other versions in the Show History dialog box.
  • After a file is pinned, the file cannot be modified. We cannot do Check In / Check Out on a pinned file.

To pin a version of a file, please follow steps below:

1. In Visual SourceSafe (VSS) Explorer, select the file that you want to pin.

2. On the menu Tools, click Show History, as seen in the following screen shot:

Show History
(Show History)

 

Or right-click the file that you want to pin, and select Show History.

Show History
(Show History)

 

3. In the History Options dialog box, click OK.

History Options
(History Options)

 

4. In the History of dialog box, select the version that you want to pin, and then click Pin. A pushpin icon will appear next to the pinned file.

Pin
(Pin)

 

SourceAnywhere - the SQL Server-based SourceSafe Replacement The SQL Server-based Source Control Software Designed to be a SourceSafe Replacement SourceAnywhere for VSS - the Fastest SourceSafe Remote Access Tool Recommended by Microsoft The Fastest SourceSafe Remote Access Tool Recommeded by Microsoft

Links:
Previous article <<<<: Label in SourceSafe / VSS
Next article >>>>: Show History in SourceSafe / VSS
SourceSafe How To series home page: VSS / SourceSafe Tutorial

No responses yet

Nov 17 2008

A Free Tool to Manage the MSSCCI Provider

Published by Kevin Gao under SourceSafe

This article is a part of SourceSafe / VSS Tutorial

Dynamsoft provides a tool called SCC Provider Manager with its SourceAnywhere product family. With this tool, you can choose one of the SCC providers in your system as the default provider. This is a screen shot of the tool:

 

SCC Provider Manager
(SCC Provider Manager)

 

With the permission of the company, I am posting the source code and the executable file here. The project was developed with Visual C++ 2003. Download SCC Provider Manager.

 

SourceAnywhere - the SQL Server-based SourceSafe Replacement The SQL Server-based Source Control Software Designed to be a SourceSafe Replacement SourceAnywhere for VSS - the Fastest SourceSafe Remote Access Tool Recommended by Microsoft The Fastest SourceSafe Remote Access Tool Recommeded by Microsoft

Links:
Previous article <<<<: Microsoft Source Code Control Interface (MSSCCI) Registry Entries
Next article >>>>:
SourceSafe How To series home page: VSS / SourceSafe Tutorial

No responses yet

Nov 14 2008

How to backup & restore SourceSafe / VSS database

Published by Kevin Gao under SourceSafe

This article is a part of SourceSafe / VSS Tutorial

SourceSafe provides an Archive utility, with which we can periodically backup our VSS Database or projects and transport files/projects between SourceSafe databases. SourceSafe also provides a Restore tool which allows us to restore the data from an archive.

  • How to archive SourceSafe database
  • How to restore SourceSafe database

 

To archive a SourceSafe database:

1. First, make sure no one is using the database we are going to archive or the Analyze utility will not run during the process of archive.

2. Open the database in SourceSafe Administrator and start the Archive Wizard through menu Archive -> Archive Projects.

3. Choose the project to archive from the project list.

Choose project to archive
(Choose project to archive)

 

4. Click Add to add more projects we would like to archive and then click Next.

Add projects you would like to archive
(Add projects you would like to archive)

 

5. Specify a name for the archive file.

Specify name for the archive file
(Specify name for the archive file)

 

6. Specify the version range of the project to archive. We may choose to archive all of the data or archive the data older than a specific version.

Specify the version range to archive
(Specify the version range to archive)

 

7. Click Finish and SourceSafe will archive the projects to an .ssa file.

 

To restore the projects from an archive file:

1. Start the Restore Wizard through SourceSafe Administrator menu Archive -> Restore Projects.

2. Select the archive file that contains the projects we would like to restore.

Select archive file
(Select archive file)

 

3. Select the projects we want to restore to the database. We can check the Display subproject option to see all the subprojects.

Select projects to restore
(Select projects to restore)

 

4. Specify the destination to restore the project. We may restore the project to where it was archived from or to a different location.

Select restore destination
(Select restore destination)

 

5. After the restore operation is finish, we may log in SourceSafe to check if the projects we want have been properly restored.

 

Note: If we want to restore a complete backup of a VSS DB, it is recommended that we restore the backup to a new VSS database rather than an existing database.

 

SourceAnywhere - the SQL Server-based SourceSafe Replacement The SQL Server-based Source Control Software Designed to be a SourceSafe Replacement SourceAnywhere for VSS - the Fastest SourceSafe Remote Access Tool Recommended by Microsoft The Fastest SourceSafe Remote Access Tool Recommeded by Microsoft

Links:
Previous article <<<<:
Next article >>>>: How to manage users in SourceSafe / VSS
SourceSafe How To series home page: VSS / SourceSafe Tutorial

9 responses so far

Next »

Version Control Software/System | Source Control Software/System | Software Configuration Management | SCM Hosting Solution | Bug Tracking System
SourceSafe (VSS) Replacement/Alternative | SourceSafe (VSS) Hosting | SourceSafe (VSS) Remote/Web/Internet Access | Scanner COM
Customer Service Software | Live Chat | Live Help | Forum Software | Knowledge Base Software | Newsletter Email Marketing Software