如何以编程方式创建SSIS包? [英] How to programmatically create an SSIS Package?

查看:81
本文介绍了如何以编程方式创建SSIS包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试以编程方式创建一个SSIS包,其中包含在同一数据库中从表A到表B的简单数据流。我正在使用此处给出的示例。
该包已创建并保存到dtsx文件,但是当我在Visual Studio中打开它时,我看到未选择源表和目标表。

I am trying to programmatically create an SSIS package containing a simple data flow from table A to table B in the same database. I am using the example given here. The package gets created and saved to a dtsx file, but when I open it in visual studio I see that the source and destination tables have not been selected.

我还想在转换任务到达目的地之前插入一个转换任务。

I also want to insert a transformation task in between before it reaches the destination.

我已经设法选择了源表和目标表,任务甚至成功运行了。原来我需要

Well I have managed to get the source and destination tables selected and the task even ran successfully. Turns out I needed to

(a)分别使用一个oleDB连接作为源和目标[我不喜欢这种方式;我只想使用一个连接]

(a) use one oleDB connection each for the source and destination [I don't like this way; I want to use one connection only]

(b)在目标 SetComponentProperty( AccessMode,3)中将Accessmode设置为3。 等同于表格或视图-快速加载。

(b) set the Accessmode to 3 in the destination SetComponentProperty("AccessMode", 3) which equates to Table or View - fast load.

在某处是否有一些文档。我所能找到的只是 SetComponentProperty 的功能,而不是它可以使用的所有参数。例如。除了 AccessMode之外,我还能在那放什么呢?第二个参数3或2或1代表什么?

Is there some documentation on this somewhere. All I can find is what SetComponentProperty does, and not what all parameters it can take to do that. eg. what else can I put there besides "AccessMode"?, what does the second parameter 3 or 2 or 1 stand for?

仍然尝试映射别名。 STOCK:PipelineTask表示数据流任务。是什么意思呢...复制列?

Still trying to map the monikers. STOCK:PipelineTask means DataFlow Task. What is the moniker for say... copy column?

推荐答案

是的,这是我对SSIS的不满之一:不提供新术语的简单表格或地图。

Yes, this is one of my frustrations with SSIS: that they do not provide simple table or map of the new terminology.

您可以使用一小段代码来发现可用的组件。

You can use a small piece of code to discover components available for use.

代码位于此处:
http://msdn.microsoft.com/zh-CN /library/ms136106.aspx

当我运行它时,我发现复制列的绰号是:
名称:复制列
CreationName:DTSTransform.CopyMap.1

When I ran it, I found the moniker for copy column to be: Name: Copy Column CreationName: DTSTransform.CopyMap.1

这篇关于如何以编程方式创建SSIS包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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