Managing Database Changes Using Manual Scripts

My need is quite simple, and I do not want to rebuild the wheel. I like the script my database and scripts are written to upgrade from one version to the next, i.e. 001-create-tables.sql, 002-alter-column.sql, etc.

What I want is a simple command line tool or MsBuild, which will look at the database, see which version the database is in (using some conditional agreement), and run all the scripts in the folder with a higher number, than the current version of the database. I would also like the tool to roll back the script if it fails / throws an error and stops at that point.

This is what I would like, but I do not mind changing my conventions, although I want to write my own sql scripts. I also want the tool to be free or open source, since I don't need too much. Since my projects are C #, I would rather have the tool embedded in .Net

+5
source share
9 answers

, - , . , . Open Source, . , , CodePlex KissDB. blog.RunXc

0
+6

SQLRunner SourceForge - #, .NET, "pre-alpha": -)

, - , .

+1

, . , , , .

, script ( /). script . script, , . , , , - .

, , . , , . ( , ). , . script , , - . , , script, , , .

+1

, , :

for %%X in (*.SQL) do SQLCMD -S <SERVER_NAME> -d <DATABASE_NAME> -E -I -i "%%X"  >> ResultBatch.txt

, , , .

0

Subversion. , . , . , SQL script , . , QA . , . , .

0

. Java, .

Yes, you can write migration scripts in your chosen SQL version.

It is well tested and used by many people.

0
source

All Articles