Should you store your SQL Stored Procedures in Source Control?

前端 未结 17 1343
南方客
南方客 2021-02-05 18:33

When developing an application with lots of stored procedures, should you store them in some sort of source versioning system (such as source-safe, TFS, SVN)? If so, why? And is

17条回答
  •  故里飘歌
    2021-02-05 19:05

    Storing stored procedures is a great idea. Its a pain though. Just how do you get all that stuff into subversion? You can manually do it, but then its tedious and you end up not doing it at all.

    I use a tool from the subsonic project.

    sonic.exe version /server servername /db databasename /out outputdirectory 
    

    This command saves everything to 2 text files. One contains database schema, stored procs, user accounts, constraints, and primary keys. The other one contains the data.

    Now that you have these two files you can use subversion(cvs,source safe) to move it into source control.

    More info for using The Command Line Tool (SubCommander)

提交回复
热议问题