2
votes

I want to read more than one table and dump its data into a file.I am not able to pass tables name dynamically to the OLE DB data source, it is working fine for one table.I am not able to see any variable in the drop down list.To accomplish this, I am using these components:

Execute SQL Task :

SELECT name FROM SYS.tables WHERE name IN('A','B')
ResultSet : Table_Name::Variable (Object Type)

ForEach Loop Container :

Foreach ADO Enumerator
variable mapping: Table_Name::Variable

DataFlow Task :

OLE DB Source  <---- How to pass table name dynamicallv
( I am trying to use Table   name variable, but when I click on drop down I don't see  any variable here, I was expecting Table_Name variable there)

Flat File Destination

Flow:

enter image description hereenter image description hereenter image description here

1
What is the scope of Table_Name::Variable? - Tab Alleman
Unless the meta data for all of the tables is the same, this will not work - billinkc

1 Answers

1
votes

Besides object variable, Table_Name, you also need to map a string variable to hold a single table name foreach loop. This is done in the Variable Mappings of the foreach loop enumerator.

Once the string variable is created, you will be able to see it in the Oledb component.