Understanding behaviour of parameter call in a SSIS SQL query inside a FOR EACH loop

Viewed 14

I am debugging some queries in SSIS and I have a doubt regarding paramters, variables and foreach loop. I have the following query in a SSIS package that is called inside a FOR EACH loop

SELECT  
[column1],
[column2]
FROM [db].[table]
where [column1]=?

As far as I understand the behaviour of parameters in SSIS when called inside a query, the ? value in the where clause should be substituted by the parameter that I can see in the Set Query Parameters window (by clicking on parameters). Let's call it parameter1.

This parameter has a hardcoded value. Parameter1 = ABC So the resulting query will be:

SELECT  
[column1],
[column2]
FROM [db].[table]
where [column1]= "ABC"

However, this query is inside a FOR EACH loop The foreach loop defines the parameters that I can see inside the package as being equal to a variable which in turn is equal to a row of an input file, which is structured like this

A B
1 ABC
1 DEF

Then defines variable1 = B and then defines the parameter1 as parameter1=variable1

QUESTION: Does this mean that even though if I click on the parameter window of my package I see nad hardcoded value (ABC), this value will be overwritten at runtime of the package by the value coming from the rows of the file following the explained flow? Am I interpreting this correctly? Is the parameter value hardcoded in the SSIS package just a placeholder that gets overwritten at runtime?

0 Answers
Related