在 SSIS 数据流任务中使用动态命名表 [英] Using dynamically named table in SSIS data flow task

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

问题描述

我是 SSIS 的新手,正在编写一个包,其中包括将数据移动到在以前的执行 SQL 任务对象中创建的表中.

I'm new to SSIS and am writing a package that includes moving data to a table that is created in a previous Execute SQL Task object.

我遇到的问题是我无法创建使用动态目标表名称的数据流目标任务.

The issue that I'm encountering is that I am unable to create a data flow destination task that uses a dynamic destination table name.

预期的过程是:

  • 执行 SQL 任务对象根据今天的日期创建新表(即 Table1_20111014)
  • 数据流任务将数据从表Table1"移动到Table1_20111014".

Table1 和 Table1_20111014 的列元数据相同,没有变化.但是,数据需要移动到的表的名称将根据执行时的日期而变化.

The column metadata for Table1 and Table1_20111014 are the same, and does not change. However, the name of the table the data needs to be moved to will change depending on the date at time of execution.

是否可以在目标数据流对象中动态指定目标表?

Is it possible to dynamically specify the destination table in a destination data flow object?

如果没有,是否有已知的解决方法或使用 SSIS 执行此任务是个坏主意?

If not, are there known workarounds or is using SSIS for this task a bad idea?

推荐答案

只要元数据保持不变,使用动态目标表名就没有缺点.

As long as the meta data remains the same, there is no drawback to using dynamic destination table name.

为了实现这一点,在 ole db 目标上,不要使用表名"或表名快速加载",而是使用等效的来自变量"表加载选项.这显然假设您定义了一个变量,其中包含在执行 sql 任务中创建的表的名称

To accomplish this, on the ole db destination instead of using "table name" or "table name fast load" use the equivalent "from variable" table load option. This obviously assumes you have a variable defined that contains the name of the table created in the execute sql task

这篇关于在 SSIS 数据流任务中使用动态命名表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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