SSIS problem creating multiline DOS batch file

Dick Rosenberg
Dick Rosenberg used Ask the Experts™
on
Hi,

I have to create a multiline DOS batch file in SSIS that looks like this:

cd e:\client\data
copy generic_output.txt clientname.yyyymmdd (yyyymmdd is today's date)

I have created quite a few single line DOS copy statements that do the copy (using a Derived column in the Data Flow) but can't come up with an approach that will allow me to create a template file that contains the (hardcoded) first line and then have a Data Flow task that writes out the first line and then have the Derived column be the second line.

Can I write out both commands in the Derived Column and put in a CR-LF in between the cd command and the copy command? Or is there a better approach?

Thanks,

Dick
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hi

I figured out a way that works. The cd command is fixed so I put that into a file. Then I used a Data Flow to build the COPY command in another file. Then I set up a copy.bat file to copy the 2 files, and then finally an Execute Process task to execute the final batch file. It works.

Thanks,

Dick

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial