Link to home
Start Free TrialLog in
Avatar of Jim Horn
Jim HornFlag for United States of America

asked on

Copy contents of multiple .sql files INTO a single .sql file

Hi All

I've got a bunch of .sql files for a SQL DTS/SP project I am getting ready to deploy.  My company requires that I have a separate file for each create table and insert needed.

I'd like a handy way to combine the contents of a give folder's *.sql into one SomeName.sql, so I can initially run them in one shot.

A manual copy/paste into a single file is not desired, as there are about 25 files.

TIA
Jim
SOLUTION
Avatar of chapmandew
chapmandew
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Its worth giving a shot though...
Avatar of Jim Horn

ASKER

At first, chapmandew's solution worked, as the files I needed to combine all had a CR as the first line.

Then today I had a need to do this with 100's of files, and I didn't want to add a CR to the front of every file, so I tried PaulHews's solution, and after a few modifications it worked.

I'm going to request an un-PAQ of this question so I can split points.

Thanks guys.
Jim
Thanks guys.  -Jim