tags:

views:

36

answers:

3

I have created several SQL database change scripts, and placed them in a folder. Is there an easy way of combining a few of them into one file or executable so that it's easier for my partner to execute them on his database?

Thanks for any help!

A: 

I think SQL packager from Red gate does this (and a lot more)

http://www.red-gate.com/products/SQL%5FPackager/index.htm

I currently use a little program a former colleague wrote that takes a list of .sql files and merges them into one file that can be run. Unfortunately I don't have the source code to provide you with a working solution.

Knocking together a quick app or script that merges all files in a folder into one long file should be fairly straight forward.

Justin Wignall
A: 

Found Simple File Joiner - http://www.peretek.com/sfj.php - does the job well and it's free! =]

Also, it seems to work on any extension, not just text files... which is ubber cool!

stringo0
A: 

You can do this with the COPY command, by using the /a switch (for ASCII).

copy *.sql /a one_big_script.sql

I typically place this command in a batch file ("make.bat") and then simply double-click it to run it and create one script out of several smaller files.

ObiWanKenobi