如何以编程方式创建 SSIS 包?
我正在尝试以编程方式创建一个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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,这是我对 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
如果您不想使用 DTS .net 程序集,您可以使用 EzApi,它提供了更简单的语法来以编程方式创建 SSIS 包。
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 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:
我曾经有一份 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.