Passing a variable from foreach loop to script task

  • I have a foreach loop that looks for a file called Acceller*.csv because it could be Acceller08102010.csv or Acceller07012010.csv, basically has a date on the end.

    I wana take that variable FileName and pass it to a script task, I have done this where it passes to dataflow

    but didn't know if there was a way to send to script task.

    Thanks, Stacey

  • Just make sure that the variable is in scope for the script task. When you start the script task, the code shows you how to reference variables. You will need to put the variable into either the read-only variables property, or the read-write variables property of the script task to be able to read or read/change the variable.

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

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

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