Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to version control my SQL server stored procedures? [closed]

What is the best way to version control my database objects? I'm using Visual studio 2005/2008 and SQL server 2005. I would prefer a solution which can be used with SVN.

like image 209
Vijesh VP Avatar asked Sep 28 '08 19:09

Vijesh VP


People also ask

Should you still use stored procedures?

Stored procedures promote bad development practices, in particular they require you to violate DRY (Don't Repeat Yourself), since you have to type out the list of fields in your database table half a dozen times or more at least. This is a massive pain if you need to add a single column to your database table.

What is the best way to execute a stored procedure in the database?

In Object Explorer, connect to an instance of the SQL Server Database Engine, expand that instance, and then expand Databases. Expand the database that you want, expand Programmability, and then expand Stored Procedures. Right-click the user-defined stored procedure that you want and select Execute Stored Procedure.


1 Answers

Same as your other code, add a "Database project" to your application solution and keep the sql files used to build the database objects in there. Use the same version control for those code files as you do for the application.

like image 106
Ron Savage Avatar answered Sep 29 '22 14:09

Ron Savage