1

I have package variable (TableName), its value is set by for each loop container.

For instance TableName = sales set by for each loop after looping through informationschema.tables then I want to use TableName's value in dataflow for this I am using script component.

When I use script component to read TableName's value in script-file I cannot see variable any idea why??

I am using script component as source and TableName is in readonlyvariables.

Please help as I am new to SSIS. enter image description here

1

3 Answers 3

0

On the Variable Mappings page of the Foreach Loop Editor, assign variables to each item of data that is returned by a single enumerated item. For example, a Foreach File enumerator returns only a file name at Index 0 and therefore requires only one variable mapping, whereas an enumerator that returns several columns of data in each row requires you to map a different variable to each column that you want to use in the Script task. +

After you have mapped enumerated items to variables, then you must add the mapped variables to the ReadOnlyVariables property on the Script page of the Script Task Editor to make them available to your script

For more details pls chk the below link

https://learn.microsoft.com/en-us/sql/integration-services/extending-packages-scripting/task/using-variables-in-the-script-task

https://social.technet.microsoft.com/wiki/contents/articles/22194.use-ssis-variables-and-parameters-in-a-script-task.aspx

Sign up to request clarification or add additional context in comments.

Comments

0

Please use the following Microsoft Documentation link - it describes differences between Script Task and Script Component, and gives small code samples, specifically on using Variables.

Comments

0

as per this I need to use this.variables.myvariable

Thanks everyone.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.