0

I'm trying to create an SSIS package that takes data from an XML data source and for each row inserts another row with some preset values. Any ideas? I'm thinking I could use a DataReader source to generate the preset values by doing the following:

SELECT 'foo' as 'attribute1', 'bar' as 'attribute2'

The question is, how would I insert one row of this type for every row in the XML data source?

4

3 回答 3

4

我不确定我是否理解这个问题......我的假设是你有n条记录从你的数据源进入 SSIS,并且你希望你的输出有n * 2 条记录。

为此,您可以执行以下操作:

  • 多播以创建输入数据的多个副本
  • 派生列转换以在副本上设置“预设”值
  • 种类
  • 合并

我是否在正确的轨道上/你想要完成什么?

于 2008-09-09T15:28:57.587 回答
2

我从来没有尝试过,但看起来你可以使用派生列转换来做到这一点:将属性 1 的表达式设置为 ,将属性 2"foo"的表达式设置为"bar"

然后,您将转换原始数据源,然后仅使用目标中的派生列。如果您仍然需要原始源,您可以多播它以创建一个副本。

根据文档,至少我认为这会起作用。YMMV。

于 2008-09-09T03:13:51.610 回答
0

我可能会切换到使用脚本任务并将您的逻辑放在那里。您仍然可以利用 SSIS 中的文件读取和其他对象来保存一些代码。

于 2008-09-17T21:56:53.717 回答