passing values through an input parameter and running the package with value provided and then looping the value of the variable to run the package again to generate a different set of files RRS feed

  • Question

  • Hi Everyone, I have a package that needs to generate a pipe delimited text file. My package uses a stored procedure to do just that. The stored procedure uses a variable and that variable needs to hold a value, so that it may generate a file for that specific value. After generating the file for the first value, the package needs to loop through and run for the second value to the variable dynamically and then generate another file for the second value. Now I believe this could be accomplished using package input parameter and then assigning the value through SQL Job where it can run the package multiple time in different steps by providing the value to the package input parameter. But I was looking for a way where it could be accomplished at the package level not at the job level.

    Thank You

    Wednesday, August 2, 2017 10:55 PM


  • Hi,

    I'd go with the stored proc wrapped into a ForEach loop container that is set to iterate over say an ADO recordset (which you populate with the rows filled with values to process).

    Set the input of the stored proc mapped to the variable obtained on each lap of the ForEach and output the data to the file as the last step in the ForEach Loop.




    • Marked as answer by super_vdawg Friday, June 14, 2019 1:03 PM
    Thursday, August 3, 2017 1:27 PM