Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Passing parametized SQL from a loop container to OLE DB source

$
0
0

I have a Foreach loop container that loops through 5 sql statements that are exactly like the one below except for the table name. These are mapped to a variable that a OLE DB source uses for its SQL command from variable. The problem is that I need to also map another variable as a parameter, and it appears 'SQL command from variable' mode in the OLE DB source only allows me to map parameters in SQL command mode only. How can I get both things (table name in SQL statement and value of parameter for st_period) to change with each iteration of the loop?

select account_number, outlet_number, dba_name, loc_address, case loc_city when '' then 'City unavailable' else loc_city end as loc_city from taxtype1 where st_period = ?


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>