Tuesday, July 24, 2012

Concatenate multiple SQL files into one big SQL file

Assuming your file naming pattern is like this:

  • 001_do_first_step.sql
  • 002_do_second_step.sql
  • 003_do_other_stuff.sql

You can concatenate them into one big, valid sql file by saving the following as a .bat file and double-clicking it:

@ECHO OFF
del allscripts.sql
for %%f in (0*.sql) do (
  echo. >> allscripts.sql
  echo ------------------- >> allscripts.sql
  echo -- Begin File: %%f >> allscripts.sql
  echo ------------------- >> allscripts.sql
  echo. >> allscripts.sql
  type %%f >> allscripts.sql
  echo. >> allscripts.sql
  echo GO >> allscripts.sql
  echo. >> allscripts.sql
  echo ------------------- >> allscripts.sql
  echo -- End File: %%f >> allscripts.sql
  echo ------------------- >> allscripts.sql
  echo. >> allscripts.sql
  echo. >> allscripts.sql
)
rem start allscripts.sql
echo allscripts.sql has been (re)created.
echo.
echo Hit enter to continue
pause

36 comments:

Anonymous said...

ωhoah this blog is fantаstic i really like ѕtudying your articlеs.
Ѕtay up the good woгκ! You realize,
а lοt of peгsons aгe lookіng round
fоr this info, yοu can аid them gгeatly.



my website - payday loans

Anonymous said...

Thanκs in support οf ѕharing suсh a fastidious thinκing, poѕt is fastidіous, thаts whу i haѵe геaԁ it fully

My wеb page - short term loans
My web page: short term loans

Anonymous said...

You should take part in a contest for one of the highest quality sites on the web.
I will highly recommend this web site!

Feel free to surf to my webpage :: http://www.travelsinindia.com/user_detail.php?u=tomgmuwut

Anonymous said...

Way cool! Some very valid points! I appreciate you writing this write-up and the rest of the site is also really good.



Feel free to visit my webpage - オークリー アウトレット

Anonymous said...

Hi there, I found your blog by means of Google while searching for a comparable topic,
your site came up, it appears great. I have
bookmarked it in my google bookmarks.
Hi there, just turned into aware of your weblog thru Google, and
located that it's really informative. I am gonna be careful for brussels. I'll be grateful should you proceed this in future.
Numerous folks will be benefited out of your writing. Cheers!


my web site :: レイバンサングラス

Anonymous said...

Link exchange is nothing else except it is simply placing
the other person's webpage link on your page at appropriate place and other person will also do similar for you.

My weblog: オークリー ゴーグル レディース

Anonymous said...

For newest news you have to go to see web and on internet I found this website as a
best website for hottest updates.

Also visit my web page - 激安オークリー

Anonymous said...

Greetings, I believe your site may be having internet browser compatibility issues.

When I take a look at your website in Safari, it looks fine but when opening in IE,
it has some overlapping issues. I simply wanted to provide you
with a quick heads up! Other than that, great blog!


My website :: オークリーメガネ

Anonymous said...

This is the right webpage for everyone who would like to understand this topic.
You know so much its almost tough to argue with you (not that I personally will need to…HaHa).
You certainly put a brand new spin on a subject which
has been written about for years. Great stuff, just wonderful!


Review my web blog - www.raybansale-shop.com

Anonymous said...

Hey There. I found your weblog using msn. That
is an extremely well written article. I'll make sure to bookmark it and return to learn extra of your useful info. Thanks for the post. I will definitely comeback.

my site :: オークリー サングラス通販

Anonymous said...

I always used to read piece of writing in news papers but now as I am a user of net therefore
from now I am using net for content, thanks to web.

Also visit my weblog: レイバン 通販

Anonymous said...

Hey there! I know this is kinda off topic but I was wondering which blog
platform are you using for this site? I'm getting fed up of Wordpress because I've had issues with hackers and I'm looking at alternatives for another platform. I would be great if you could point me in the direction of a good platform.

my homepage 激安レイバン

Anonymous said...

Unquestionably believe that which you said. Your favorite justification appeared to be on the net the
simplest thing to be aware of. I say to you, I certainly get annoyed while people consider worries that they plainly do
not know about. You managed to hit the nail upon the top and also defined out the
whole thing without having side-effects , people can take a signal.
Will probably be back to get more. Thanks

Here is my web site http://www.islamicebooksonline.com/members/profile/4384/HLXLatoya

Anonymous said...

Hi there, this weekend is pleasant in favor of me, since this time i am reading this impressive informative article here at my residence.



Here is my blog post: click the up coming webpage

Anonymous said...

What i don't realize is actually how you are not really much more well-preferred than you might be right now. You're so intelligent.

You recognize therefore significantly when it comes to this subject,
produced me personally imagine it from so many numerous
angles. Its like women and men are not fascinated until it is
something to accomplish with Woman gaga! Your individual stuffs great.
All the time take care of it up!

my web-site ... オークリー

Anonymous said...

whoah this weblog is excellent i like studying your articles.
Keep up the great work! You realize, many individuals are looking round for this information, you can aid them greatly.



Feel free to visit my website ... oakley サングラス

Anonymous said...

Truly when someone doesn't be aware of then its up to other visitors that they will assist, so here it takes place.

My weblog; レイバン

Anonymous said...

Thanks to my father who told me concerning this webpage, this website is in fact remarkable.


my page :: ジョーダン

Anonymous said...

Woah! I'm really enjoying the template/theme of this blog. It's sіmple,
yet effectivе. A lot of times it's challenging to get that "perfect balance" between user friendliness and visual appeal. I must say you've donе a fantastic job with thіs.
Adԁitіonally, the blog loads supеr fast for me on
Chгomе. Outstandіng Blog!

Also vіsit my web pagе :: payday loans

Anonymous said...

I cοuld not rеfraіn from commenting.
Vеrу wеll written!

Viѕit my web ρаge ... payday loans

Anonymous said...

Post writing is also a fun, if you be acquainted with afterward you can write if
not it is complicated to write. Cheap Auto Insurance Quote - cheap auto insurance quote - http://sosnovka.su/node/876188

Here is my page: Cheap Auto Insurance Quote

Anonymous said...

Ηi! I could haѵe sωorn ӏ've been to this website before but after reading through some of the post I realized it's new to me.
Nonetheless, I'm definitely glad I found it and I'll be
bookmarking and checking bаck frequentlу!


Visit my blog - Americas Cardroom Poker Bonus

Anonymous said...

I love it when folks come together and share ideas.

Great blog, stick with it!

Feel free to visit my site プラダアウトレット

Anonymous said...

Thankfulness to my father who stated to me
concerning this blog, this weblog is actually awesome.


My web-site レイバンメガネ

Anonymous said...

First off I would like to say fantastic blog! I had a quick question in which I'd like to ask if you don't mind.
I was curious to find out how you center yourself and clear
your mind before writing. I've had difficulty clearing my mind in getting my ideas out there. I truly do enjoy writing but it just seems like the first 10 to 15 minutes are usually lost just trying to figure out how to begin. Any ideas or tips? Thanks!

Here is my site: ロレックス時計

Anonymous said...

Paragraph writing is also a excitement, if you be acquainted with then you can write if
not it is difficult to write.

My blog post; モンスター ヘッドホン

Anonymous said...

There is definately a great deal to know about this subject.
I love all of the points you've made.

Here is my blog post - プラダ 財布

Anonymous said...

With havin so much written content do you ever run into any issues
of plagorism or copyright violation? My site has a lot of completely unique content I've either authored myself or outsourced but it looks like a lot of it is popping it up all over the web without my agreement. Do you know any methods to help stop content from being ripped off? I'd really appreciate it.



Look at my blog :: ロレックスコピー

Anonymous said...

Thanks a bunch for sharing this with all of us
you really recognize what you are talking
approximately! Bookmarked. Please additionally seek advice from
my web site =). We will have a link change arrangement between us

Also visit my homepage: クロエバッグ

Anonymous said...

I am sure this piece of writing has touched all
the internet people, its really really nice article on building up new web
site.

My blog post: monster beats

Anonymous said...

a week and also transform your physique very quickly.
Humans, naturally, do not like bitter flavors or foods.
A great way to always maintain the proper form is to leave your feet firmly planted on the ground,
and always grip the bar no more than shoulder width
apart.

My website - Power Pump XL Muscle Building

Anonymous said...

I feel аѕ though I сould learn about this for houгs, it's riveting. I don't eνеn nеeԁ a tea yеt.



Here iѕ my weblog ... http://www.almostmd.com/index.php?do=/profile-43662/info

Anonymous said...

Fine wаy оf dеscribing, and fastidious article to take data regarding my ргeѕentation subjeсt,
whiсh i am goіng to сonvey in aсademy.


Αlso visit my blog ... http://solseeds.com/AndrewSayles

Anonymous said...

Ѕpot οn ωith this write-up, I truly believe
this web ѕite needs fаг morе attentіon.

I'll probably be back again to read more, thanks for the info!

Also visit my blog post High Stakes Offer :: ::

Anonymous said...

Whoa! This blog looks exactly like my old one! It's on a totally different topic but it has pretty much the same layout and design. Superb choice of colors!

Feel free to visit my weblog: Buy Acai Energize

Anonymous said...

Everything iѕ very оpen wіth a precіse сlarifiсatiοn of the issueѕ.
Ιt was trulу informative. Your website is eхtremely helpful.
Thank уou for sharing!

my web site: RPϺPoker Offer []