Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am working with a team of 5 persons. We are using SQL Server as our database. Since long time I want to store the Stored Procedures in SVN so that the versions can be maintained. Is there any tool which can be used as a plugin with SQL Server Management Studio and allows checkin from there.

share|improve this question
add comment

3 Answers 3

Sounds like Red Gate's SQL Source Control might be what you're looking for.

It says it connects to "TFS, SVN, SourceGear Vault, Vault Pro, Mercurial, Perforce, Git, and any source control system with a capable command line," and that it "links your databases to your existing source control system straight from SSMS".

I haven't used it personally, but I have used other Red Gate SQL tools, and they have been excellent.

share|improve this answer
    
I am looking for some open source tool. Redgate tools are right now not fitting our budget. –  Kuntal Shah Sep 3 '11 at 10:44
add comment

SSDT projects are great for this these days.

You keep all your db & proc & function definitions in script files (which define your model) and within Visual Studio sync the model with your database / publish to a database to update it. As all your object definitions are in script files you can have them under source control using SVN/Hg/whatever.

share|improve this answer
add comment

If I remember correctly (it's been years since I've used SQL Server), you can execute external scripts using osql.

For each stored procedure, I'd write a sql script that removes the current one (if it exists) and creates the new version. Saving these in external .sql files will allow you to easily commit them to any versioning system. Then, you could write a script using your language of choice to update the database whenever you want.

Obviously you'd want to create a backup of your current database prior to running your script in case all goes to hell.

share|improve this answer
    
I am looking for some more automated way that may be more error free. –  Kuntal Shah Sep 3 '11 at 10:53
    
It works pretty well (we do that here) but the key is that nothing is ever put on QA or prod unless it comes form the source control system. Since devlopers do not have the rights to deploy to other servers, their code doesn't get deployed unless they check it in. –  HLGEM Feb 6 '13 at 20:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.