Can I create a "stand alone" data migration script?

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

Can I create a "stand alone" data migration script?

Postby jswartsel » Wed Jul 25, 2012 6:55 pm

Hey everyone,

My team is evaluating SQL Source Control and we are hung up on something. I know that you can create custom migration scripts and associate them with a change-set (ala schema change). So for example if I am adding a non-nullable column to a table with records in it, I could attach a custom migration script that would provide values.

Now let's say I've been given a requirement that in the next version of our software, all e-mail addresses in a particular column should be updated to be in ALL CAPS. This would be accomplished by a single UPDATE statement, but wouldn't require any schema changes.

As a developer, I would want to be able to check this update script in to source control along with all my other source controlled scripts, so that when I go to build, our Continuous Integration process will update all email addresses in the QA database. Similarly, I want this script to run when we deploy to production using the accumulated set of change-set scripts.

Is there any way to check in a data-only migration script that is not associated with a schema change?

Thanks,
Justin Swartsel
jswartsel
 
Posts: 1
Joined: Wed Jul 25, 2012 6:38 pm

Postby David Atkinson » Wed Jul 25, 2012 10:10 pm

This isn't yet possible, although it's something that we'd like to allow eventually. The workaround is to put the data migration script in a migration script alongside a schema change.

David Atkinson
Red Gate
David Atkinson
 
Posts: 1124
Joined: Mon Dec 05, 2005 4:54 pm
Location: Twitter: @dtabase

Postby bdw429s » Thu Aug 16, 2012 5:52 pm

I asked the same question in this thread:
http://www.red-gate.com/MessageBoard/vi ... hp?t=15664

I finally found this User Voice request which I voted for. Please vote for it too.

http://redgate.uservoice.com/forums/390 ... to-any-dat
bdw429s
 
Posts: 20
Joined: Thu Aug 09, 2012 4:05 pm
Location: Kansas


Return to SQL Source Control 3

Who is online

Users browsing this forum: No registered users and 0 guests