Reputation: 123
I'm using SSIS to grab data from a Netezza db and inserting into SQL Server db. I have the queries working, and the first 2 queries use a data flow task to grab from Netezza (based on an ID_NUMBER
) and inserted into SQL Server.
I have 15 different ID_NUMBER
s to run against, and I want to run them one at a time, but I don't want to hard code the ID_NUMBER
into the SQL statement each time I want to run a different ID_NUMBER
.
Is there a way I can loop through each ID_NUMBER
without hardcoding them in the SQL Statement?
Upvotes: 2
Views: 1016
Reputation: 37313
Based on your comments you are using ODBC source
In ODBC you cannot use parameters (same logic in link provided), you have to assign an expression to the SqlCommand Property of the ODBC Source
Assign a similar expression to [ODBC Source].[SqlCommand]
property
"SELECT * FROM MyTable WHERE [id] = " + (DT_WSTR,50)@[User::id]
Click on the DataFlow Task and change the Delay Validation
property to True
For a Step-by-Step Tutorial you can refer to the following Link:
Upvotes: 2