如何以编程方式创建 SSIS 包?

发布于 2024-07-07 06:05:19 字数 726 浏览 4 评论 0原文

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

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


编辑

好吧,我已经成功选择了源表和目标表,并且任务甚至成功运行。 结果我需要

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

(b) 在目标 SetComponentProperty("AccessMode", 3) 中将 Accessmode 设置为 3,这相当于表或视图 - 快速加载。

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

仍在尝试绘制绰号。 STOCK:PipelineTask 表示数据流任务。 比如说……复制栏的绰号是什么?

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.


EDIT

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

(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) set the Accessmode to 3 in the destination SetComponentProperty("AccessMode", 3) which equates to Table or View - fast load.

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?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

可爱咩 2024-07-14 06:05:19

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

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

代码位于此处:
http://msdn.microsoft.com/en-us/library/ms136106。 aspx

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

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.

The code is located here:
http://msdn.microsoft.com/en-us/library/ms136106.aspx

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

孤独岁月 2024-07-14 06:05:19

如果您不想使用 DTS .net 程序集,您可以使用 EzApi,它提供了更简单的语法来以编程方式创建 SSIS 包。

EzAPI 是一个由 Evgeny Koblov(SSIS 团队的测试人员之一)用 C# 编写的 .NET 库,它抽象了直接用编程语言创建 SSIS 包 XML 所需的大量繁琐的低级编码

EzApi 最初作为一部分发布由 Microsoft 产品团队创建的 SSIS 社区示例项目:

后来它作为一个单独的项目发布以添加对 SQL Server 2016 的支持:

要开始使用 EzApi,您可以参考互联网上的许多链接,例如:

If you don't want to use the DTS .net assemblies you can use EzApi which provides a simpler syntax to create SSIS package programmatically.

EzAPI is a .NET library written in C# by Evgeny Koblov one of the testers on the SSIS team to abstracts away a lot of the cumbersome low-level coding needed to create SSIS packages XML directly in a programming language

EzApi was first published as a part of the SSIS community samples project created by Microsoft product team:

And later it is published as a separate project to add support SQL Server 2016:

To get starteed with EzApi there are many link on the internet that you can refer to such as:

夏有森光若流苏 2024-07-14 06:05:19

我曾经有一份 SQL Server 2005 Integration Services,一本 Wrox 书籍。 我很确定它有一两章专门讨论以编程方式使用 SSIS 包。 你可以去当地的书店翻一下,也许有你想要的。

抱歉,除了书籍参考之外,我无法为您提供更具体的信息。 祝你好运。

I used to have a copy of SQL Server 2005 Integration Services, a Wrox book. I am pretty sure it has a whole chapter or two dedicated to programmatically working with SSIS packages. You may want to check out a local book store and flip through it, it may have what you want.

Sorry I can't give you anything more specific than a book reference. Good luck.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文