Need a good schema / workflow for managing database objects using Subversion

How do you track or manage stored procedures, views, and functions in SQL Server?

I would like to use Subversion, but it looks like I would just need to save and commit the CREATE / ALTER statements. It might work well for me, but I suspect I will end up grumbling a lot.

Does anyone use version control with their databases? Is there a better way?

In the past, people simply commented out parts of the code and left it. Or they add a few comments “added to the comments on 2/31/2010”. It drives me crazy because I know there is a better way.

We write changes to the title of the object, but this is rather limited. This would make my life easier to differentiate between versions.

Additional Information
We use SQL Server 2005. I have Subversion (via VisualSVN Server) and TortoiseSVN, but I am open to other suggestions.

By database objects, I mean, for example, stored procedures, views, and functions.

There are only a few tables that I will need to track. The database is the database for the commercial application, and we mainly extract information for reporting

I found a related question about version control of stored procedures

+3
source share
5 answers

script Subversion. Prod script ( prod), prod , Subversion.

+2

, , dw, etl, , , !

, .. - , .

+1

Liquibase,

/ sql svn . /sproc/etc...

+1

, " ". , , .., ? ?

, . ( NHibernate - ). sql, . . , .

0

, , , :

  • // ( , "" ). , .
  • - DROP/CREATE, . ALTER, .

, , , , - , , DB - /, . , , .

  1. The data in the tables. We examined several approaches here: either a series of INSERT instructions stored in a file, for example, “TableName_Data.sql”, or a CSV file with a custom assembly tool that was analyzed and inserted when restoring the database.

In the end, we went with INSERT instructions for simplicity.

0
source

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


All Articles