Running Batch file from Execute Process Task

  • Hello everyone,

    I am on the final section of a project and it requires the merging of three files into one. it's effectively one header record, the main data and then the trailer record.

    I've been told the best way to do this in SSIS is to create a batch job and then incorporate into the Execute Process task.

    Firstly, I'm new to batch jobs but my understanding is that the command line to concetenate seems fairly simple (copy file.txt + file2.txt file3.txt) and i tried this on my local drive and all ok.

    So i have a few questions:

    The location were I have the .bat file contains spaces in the path names(i did not create these), so i have added quotes around the filenames.

    When setting up the process task, for the executable section, i find the location of the .bat file. Now, the drive is mapped locally to my machine or I can put in the full network path.

    For the working directory, I again put the folder location where the .bat and files sit

    i do not enter any more parameters into the task.

    When i execute, I get the error

    [Execute Process Task] Error: In Executing "H:\DBA Documentation\ADMS\Over50\T3\FilesMerge.bat" "" at "H:\DBA Documentation\ADMS\Over50\T3", The process exit code was "1" while the expected was "0".

    so not sure how I should be setting up the process task?

    Any ideas?

    Thanks

    Haythem

  • Use a UNC path rather than a mapped drive.

    --edit

    You could also try changing the Success Value to 1 - if you think that the batch file is executing OK.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • all sorted. cheers Phil

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply