Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Azure schema upgrade strategy

i'm currently working on a asp.mvc application with entity framework as db backend which will be running on ms azure platform.

on my development machine i'm running a sqlexpress instance which hosts my development database (like i said may app connects via entity framework to it).

deploying the database schema from my local sqlexpress to sql azure is pretty easy via the entity framework database generation wizard (for whatever reasons the wizard always wants to create some clustered indexes which i correct manually in the generated sql file).

but i can't figure out a way to keep my data! the auto generated sql script always dumps all my tables and creates new ones...thats ok for initial setup, but not to upgrade a existing database.

there must be a nice way to perform a schema update without dataloss...please help! i have already tried sql management studio (r2) and SQLAzureMW (available on codeplex)...but they don't do the job :(

please don't tell me i have to code my own tool to do that!

looking for your help

thx

Edit: here's how i do it now

I use the SQL scripts created by the EF migration wizard for my local SQL Express and modify them myself to be compatible with SQL Azure. Is less work that one might think and works perfect :)

like image 929
Matthias Avatar asked Nov 12 '10 02:11

Matthias


1 Answers

Have you tried to use BCP to export and then import your data? I believe you should be able to use BCP to export data from your SQL Express instance into a file, and then import data from the file into SQL Azure. The SQL Azure team has a blog posting that describes using BCP with SQL Azure - Link.

Additionally, in the future, the upcoming release of SQL Azure Data Sync CTP2 might be able to help you out.

Out of curiosity, what problems where you having with SQLAzureMW?

like image 106
mcollier Avatar answered Sep 21 '22 07:09

mcollier