SSIS:动态传递表名 [英] SSIS : Dynamically passing Table names

查看:34
本文介绍了SSIS:动态传递表名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想读取多个表并将其数据转储到一个文件中.我无法将表名动态传递给 OLE DB 数据源,它对一个表工作正常.我看不到任何下拉列表中的变量.为此,我使用了以下组件:

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:

执行 SQL 任务:

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

ForEach 循环容器:

ForEach Loop Container :

Foreach ADO Enumerator
variable mapping: Table_Name::Variable

数据流任务:

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

流程:

推荐答案

除了对象变量 Table_Name 之外,您还需要映射一个字符串变量来保存单个表名 foreach 循环.这是在 foreach 循环枚举器的变量映射中完成的.

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.

创建字符串变量后,您将能够在 Oledb 组件中看到它.

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

这篇关于SSIS:动态传递表名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆