How to commit custom script in source control & deployment

A SQL Server Management Studio add-in to source control your database in Subversion or Team Foundation Server.

Moderators: Chris Auckland, David Atkinson, sherr, PhilScrace, andy.campbell.smith

How to commit custom script in source control & deployment

Postby joseph.tg » Thu May 30, 2013 8:01 am

Hi Team,

Most part of our changes are not going to be schema or any other db object changes but it will be from DDLs, inserts, updates and deletes

1. How to make sure DDLs supported in this auto deployment, this is not just for static tables but any data manipulation script for any table

2. How we can commit and deploy the custom script through source control

3. How ordering of scripts can be done when required, there can be situation where script 1 need to be run after script 3 and check in order can be different.

Thanks in advance!!

Joseph
joseph.tg
 
Posts: 11
Joined: Thu May 30, 2013 7:53 am

Postby james.billings » Mon Jun 03, 2013 12:44 pm

Thanks for your post.

Unfortunately you cannot easily commit custom scripts on their own with SQL Source Control.

We have a facility called "Migration Scripts" which lets you add your own scripts (see here) but these are created at the point you commit other changes (you can't create them on an ad-hoc basis)

You also cannot really control the ordering of the scripts. A migration script will cover changes between a pair of revisions of changes; so a script covering an earlier set of revisions would usually get run before a script covering later revisions, however the only way to ensure everything was run in a specific order would be to have one script containing everything.
james.billings
 
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.


Return to SQL Source Control 3

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests