I have a SQL query that's being executed in SSIS to load data into a CSV file that looks something like this:
SELECT *
FROM SomeTable
WHERE SomeDate BETWEEN '1-Jan-2016' AND '31-Dec-2016'
AND Param1 = 2 AND Param2 = 2
When this was written in QlikView, I used parameters like so:
SELECT *
FROM SomeTable
WHERE SomeDate BETWEEN '1-Jan-2016' AND '31-Dec-2016'
AND Param1 = $(Param1) AND Param2 = $(Param2)
Now that I'm migrating the entire task to SSIS, I'm figuring out how to get it such that Param1 and Param2 would be dynamically assigned. For example, in QlikView, I created a table that was populated by another query:
SELECT Param1, Param2
FROM ThisTable
WHERE SomeID = 1
Something like that. The selection of Param1 and Param2 from that query gets me the necessary values for $(Param1) and $(Param2) in my QlikView code.
I'm right now trying to convert my QlikView code into an SSIS package instead since SSIS is a dedicated ETL tool whereas QlikView isn't. Is what I'm doing possible? And if so, how would I go about doing it?
My idea was to wrap it all in a for loop container and have it stop after it grabs the last Param1 and Param2 from this query:
SELECT Param1, Param2
FROM ThisTable
WHERE SomeID = 1
Basically, I'm trying to avoid having to write my first select statement a thousand times over.
Thank you.
If what I'm saying doesn't make sense, please let me know so I can elaborate a bit more.







