Stored Procedure Versioning

后端 未结 4 1531
-上瘾入骨i
-上瘾入骨i 2021-01-02 17:08

How do you manage revisions of stored procedures?

We have a BI solution on SQL Server 2005 with hundreds of stored procedures. What would be a good way to get these

4条回答
  •  走了就别回头了
    2021-01-02 17:55

    There are doubtless a bunch of off-the-shelf products you could buy (I think a few RedGate tools might come in handy here), as well as Visual Studio Team Suite - Database Edition.

    In light of purchasing something, why not consider using SQL Management Objects (SMO)?

    I've written a couple of utilities which generate T-SQL scripts (using the Scripter class) which produces the same scripts you get from generating scripts through the SQL Server Management Studio (it uses the same functionality).

    You could integrate such a utility into a build script/build process which would allow you to generate scripts and then version & check them into a source repository. Plus, you can batch the scripts into a single file (if desired) which beats maintaining hundreds of individual files.

    I wrote a blog entry about this approach a while back.

    Check out more on the SMO class Scripter

    Here's a few more entries which might be useful:

    http://www.sqlteam.com/article/scripting-database-objects-using-smo-updated

    http://sqlblog.com/blogs/ben_miller/archive/2007/10/03/table-scripting-with-smo-part-1.aspx

提交回复
热议问题