1

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

Hadi
  • 36,233
  • 13
  • 65
  • 124
Miscode
  • 57
  • 8

1 Answers1

2

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

Dts.Variables["varInputFile"].Value

Reference

Hadi
  • 36,233
  • 13
  • 65
  • 124
  • 1
    Thnx, it did work. Do you know why they made this difference? One time you can use Variables. the other time you need to use your answer... – Miscode Jul 26 '19 at 14:25
  • @Miscode check the following article, you will find the difference in the comparison table: https://learn.microsoft.com/en-us/sql/integration-services/extending-packages-scripting/comparing-the-script-task-and-the-script-component?view=sql-server-2017 – Hadi Jul 26 '19 at 14:29