SSIS : Dynamically passing Table names

2019-08-02 02:42发布

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 here enter image description here enter image description here

标签: ssis
1条回答
三岁会撩人
2楼-- · 2019-08-02 03:19

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.

查看更多
登录 后发表回答