Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm looking for a tool that will allow the user to add sql file(s) to be run in a specific order against a specific DB. Right now the process is very manual by opening the SQL file and hitting F5... I'm thinking there has to be a more automated way of doing this.

Anyone know of any tool that exists like this?

share|improve this question
2  
We build such a tool last week, took us only a few days. The user enters SQL queries into an Excel-Sheet, then the queries are run one-by-one and the results go into a new Excel document, each query result to a different sheet. Perhaps easiest solution is that you create your own tool for your needs? P.S.: your question is clearly off-topic for this site, voting to close. – Doc Brown Jun 8 '12 at 16:45
Please see the FAQ. Questions about what tool or technology should I learn next are strictly off topic. – maple_shaft Jun 9 '12 at 19:48

closed as off topic by gnat, Doc Brown, MainMa, Walter, maple_shaft Jun 9 '12 at 19:47

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

3 Answers

http://www.red-gate.com/products/dba/sql-multi-script/

RedGate SQL Multi-Script

We use it to great effect in our environment.

share|improve this answer

You can write a program (e.g. C# on Windows) or a script (e.g. ksh on Unix) to do this. You could then schedule it using your OS scheduler (there are many 3rd party tools for scheduling some are free). The above is quite possible at least for Windows and Unix. I recommend that your program/script keeps track of before and after activities in a log file and clearly checks dependencies before a job starts (if you need this type of actions in your system). Databases such as Oracle and most ETL software provid schedulers that are also customizable for such tasks. Make sure that the no one turns that server down though :)

share|improve this answer

Liquibase is .. "for tracking, managing and applying database changes. It is built on a simple premise: All database changes are stored in a human readable yet trackable form and checked into source control."

Basically it looks like this:

<changeSet author="bob" id="BUG-1234>
 <sql>
  INSERT INTO ...
 </sql>
 <sql>
  ALTER TABLE ...
 </sql>
 <sql>
  DROP INDEX ...
 </sql>
</changeSet>
<changeSet author="peter" id="BUG-1235>
 <addTable ...>
 <modifyDataType ...>
 <addColumn ...>
 <dropView ...>
</changeSet>
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.