Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662

    Unanswered: SSIS - Execute Process Task with batch

    I am trying to convert my command line FOR loop with a FOREACH component in SSIS, iterating through a set of files in a subdirectory. FOREACH works fine, but the stumbling point for me is to call a batch script passing a file name as a parameter. OS operations are working correctly in that loop, like COPY, MOVE, DELETE, and are properly interpreting the file name variable. Only calling a batch file seems to be a problem. For simplicity and troubleshooting purposes I replaced the actual batch script with this version:

    echo %1
    pause

    FOREACH loop correctly displays a command window for each file encoutered in the subdirectory (for 10 files cmd window show up 10 times with a pause). But the ECHO statement displays my package variable, as I typed it in the Arguments property of Execute Process Task component, @[User::fileName].

    Any trick there that I am missing?
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Not having a copy of SSIS in front of me this is a pretty wild stab - but don't you have make @[User::fileName] an expression on prior to assigning it as an arguement?

    If I get a chance I'll try tomorrow afternoon.

    meh.
    George
    Home | Blog

  3. #3
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Not sure what you mean by
    Quote Originally Posted by gvee
    ...but don't you have make @[User::fileName] an expression on prior to assigning it as an arguement?
    , but I did test User::fileName variable to acquire a file name for each file retrieved by FOREACH container. I tested it using "File System Task" component with COPY, MOVE, and DELETE commands.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  4. #4
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    OK, so the Arguments property needs to be assigned in Expressions, rather than on the Process tab of the "Execute Process Task" editor...Now it makes sense
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  5. #5
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    That's the badger!
    Did that get you rockin' in the end?
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •