Jader Dias
Jader Dias

Reputation: 90475

How to source control stored procedures with SQL Server 2005 and Visual Source Safe 2005?

I am trying to follow the steps on the following site

http://msdn.microsoft.com/en-us/library/ms181089(VS.80).aspx

But I couldn't find the "Data View window and an Add to Source Control command" in the SQL Managment Studio. Then I tried to Modify a stored procedure and then I clicked on the "Change Source Control" button at the "Source Control Toolbar". Besides the SQL Server machine's Visual Source Safe client connects to my Visual Source Safe repository, I couldn't change the bindings of the stored procedure because of the following error message:

Cannot change source control bindings. Ensure that each project has a valid binding.

I don't know what to do anymore. Any idea?

Upvotes: 0

Views: 2367

Answers (4)

Mehmet Aras
Mehmet Aras

Reputation: 5374

Have you checked the source control settings in SQL Management Studio? Tools>Options then Source Control. Make sure that SourceSafe is set as the current source control plug-in. I think for your scripts, you could create a script project (File>New>Project>SQL Server Scripts) and then start adding scripts. If you right click on the script project, you should see 'Add Solution to Source Control'.

Upvotes: 1

Christopher Klein
Christopher Klein

Reputation: 2793

Check out this site: VBScript with SQLDMO basically what we do in-house is we wrote a vbscript file that uses SQLDMO to output the contents of all of the SQL objects out to a directory, then we use the SourceSafe object thru vbscript to manage the version control. Unfortunately I cannot post the code since my boss also frequents this site ocassionally ;)

We have recently switched from VSS to TFS and wrote a process to manage that in .NET, handles alot cleaner.

Upvotes: 0

Paulo Santos
Paulo Santos

Reputation: 11567

Personally, I don't use Source Safe directly with SQL Server to keep track of my database artifacts, I create a Database project and link it to the Source Control.

Doing it this way you keep the Source Safe integration with Visual Studio and SQL Server too.

Upvotes: 2

Nathan Ridley
Nathan Ridley

Reputation: 34396

Write your stored procedures in script files and commit those. When you make a change, edit that file and commit it just like normal source code. Writing your stored procedures as scripts will also save you time later if you want to script out your database.

Upvotes: 2

Related Questions