Search code examples
sql-serverssisetlscript-taskssis-2017

Variables not generated in script task


For some reason my variables which I have added to the readonlyvariables(also tried readwritevariables)are not generated in code when I want to use them in code. What am I missing? I've added this script task in the Control Flow. When adding it in a data flow, it works fine. Is this the problem?

Regards!

enter image description here

enter image description here


Solution

  • Within a Script Task you have to use the following syntax:

    Dts.Variables["varInputFile"].Value
    

    Reference