Retrieving a stored procedure control source

Primarily:

We use VS 2008 pro and start the MS SQL 2008 server. For sourcecontrol we use Subversion.

We really would like to keep our stored procedures in subversion so that we can find out what was changed, when, etc.

However, for this to work, it must be smooth, otherwise developers will simply forget to get the procedures included in their commits.

So, are there any good solutions for this?

I am sure that we cannot be the only company with this problem :-)

+4
source share
6 answers

I am currently using a free tool called SQL Source Control from Red-Gate for this, and it works great, it connects to SSMS. Here is a link with additional information http://www.red-gate.com/products/SQL_Source_Control/index.htm I should mention that it is currently in beta, but works great with SVN and TFS.

+2
source

In our company, we use the Team Foundation server for the Visual Studio command system to track code versions and manage stored procedures versions; stored procedures are processed just like any other source of code.

The database does not automatically synchronize with TFS; therefore for each new SP you need:

  • Create it
  • Add it to TFS
  • registration
  • Add to database

if you need to change:

  • Log on to TFS
  • Change Source
  • Log in to TFS
  • Edit in database

When we need to fix production, we officially ask dba to synchronize the new / modified stored procedure with our production database and download the latest version from TFS.

Possible problem scenario:

  • Lazy developers (like me) modify the SP directly on the Sql server and do not align the code on TFS
  • Crazy developers (like me) forget to check the latest fixed version and alignment dba listening in production
+3
source

In Visual Studio 2008, you can create a database project that allows you to store all your stored procedures and any other SQL queries in a good project, which can then be placed in Subversion.

+3
source

If you are following a flexible method, I suggest you add β€œRemember to commit SP” to your Done, Done so that it becomes a natural part of your process.

+1
source

I really love Visual Studio Team Edition for database professionals, which you can now use if you have Visual Studio Team Edition for developers . This will allow you to work with database objects in a stand-alone model that can be validated in the original control. The stand-alone model is then used to automatically create deployment scripts in the database.

The only drawback is the price.

0
source

We have a program that makes any necessary changes to the database versions when the program is installed / updated.

So, to deploy any SQL code, it must be included in this program (as resources in our case). This allows automatic version control and adding code to the version control system supported by VS.

For more details see a more detailed description of our system .

0
source

Source: https://habr.com/ru/post/1305074/


All Articles