[cvsnt] Re: Managing SQL Server source with CVS?

Bo Berglund bo.berglund at telia.com
Mon Nov 10 20:05:47 GMT 2003


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


On Mon, 10 Nov 2003 10:13:11 +0000 (UTC), "Oliver Giesen"
<ogware at gmx.net> wrote:

>Hi all!
>
>I was approached by our chief database developer to ask the following
>question (he's not quite as firm with CVS himself):
>
>Does anyone know of any tools available that could ease version
>management of (MS) SQL Server sources? Our apps are for a large part
>written as stored procedures and triggers. Currently the way is to
>initiate an export to files and check those files into CVS.
>We use Enterprise Manager's built-in Generate SQL Script function to
>create one script per object (over 900 in our biggest app). This is
>rather tedious and error-prone and not really as "two-way" as we'd like
>it to.
>
>Is there maybe a tool or script that could be plugged right into
>Enterprise Manager? How do others handle this?
>
>So far, all I've found are either descriptions of what we're already
>doing or plugins for VSS. Does maybe anyone know of a general
>SCC-plugin which we could then connect to CVSNT via Igloo?
>
>Cheers,

Hi Oliver,
we have decided to do it this way:
1. *ALL* of the database definitions are done in Transact-SQL
2. We separate them in various sql files depending on purpose/target:
   - Security, like logins, users, passwords etc (master)
   - Backup stuff, we schedule automatic backups (master)
   - Structural info like table design and indexes etc (user)
   - Views (user)
   - Stored procedure definitions (user)
   - System data, fixed definitions etc (user)
   - Metadata, language dependent strings etc (user)
3. These sql files are written in QueryAnalyzer, tested there
   and then saved as sourcecode.
4. We have stored these files under CVS version control (of course)
5. We also have created a Delphi app that takes a list of these
   files and connects to the SQL server and then executes them to
   set up the database correctly.
NOTE: The scripts we do are fully rerunnable, that means we make sure
that all changes are done in a non-destructive way on live databases.
The procedures are dropped then reinserted, columns are never dropped
etc.

When we started out we tried using Enterprise Manager but soon found
that it was a nightmare to manage and support this code so we hired an
SQL sexpert and restarted it from scratch. Now we are in good shape.



/Bo
(Bo Berglund, developer in Sweden)


More information about the cvsnt mailing list
Download the latest CVSNT, TortosieCVS, WinCVS etc. for Windows 8 etc.
@CVSNT on Twitter   CVSNT on Facebook