如何在 VB 中以编程方式编辑 SSIS 包?

编程入门 行业动态 更新时间:2024-10-28 02:29:09
本文介绍了如何在 VB 中以编程方式编辑 SSIS 包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们已经创建了一个作为 SSIS 包的工作流过程,并希望找到一种方法来访问此代码,以便我们可以通过 vb 动态访问和运行该代码.例如,我们想更改正在使用的数据源,或更改现有包的列映射,然后从 vb 应用程序执行它们.请建议最好的方法.

We have created a workflow process as an SSIS package and would like to find a way of gaining access to this code so that through vb we can dynamically access and run that code. For example, we would like to change the data sources being used, or change the column mappings of existing packages and then execute them from a vb application. Please advise the best way to do this.

推荐答案

你会发现你的一些任务很容易,而另一些则不然.

You will find some of your tasks easy, others not so much.

一般来说,您会感兴趣阅读集成服务开发人员指南.特别感兴趣的是以编程方式构建包和以编程方式运行和管理包.

Generally speaking, you'll be interested in reading the Developers Guide to Integration Services. Of particular interest will be Building Packages Programmatically and Running and Managing Packages Programmatically.

例如,从 VB.NET 运行包

Imports Microsoft.SqlServer.Dts.Runtime Module Module1 Sub Main() Dim pkgLocation As String Dim pkg As New Package Dim app As New Application Dim pkgResults As DTSExecResult pkgLocation = _ "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services" & _ "\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx" pkg = app.LoadPackage(pkgLocation, Nothing) pkgResults = pkg.Execute() Console.WriteLine(pkgResults.ToString()) Console.ReadKey() End Sub End Module

要以编程方式更改连接管理器,它与 VB.NET 等效

To change the connection manager programmatically, it'd be the VB.NET equivalent of

ConnectionManager item = ep.Connections["MyConnectionManagerName"] item.ConnectionString = @"Provider=SQLNCLI10.1;Data Source=Server1;Initial Catalog=ABC;Integrated Security=SSPI;";

改变列映射,这就是它会变得有趣的地方,对于这个词的所有定义.我有一个精炼的例子,但它需要一些工作,你会想要真正理解整个对象模型(我希望你喜欢 COM).EzAPI 可能在这方面有所帮助.

Changing column mappings, that's where it's going to get interesting, for all definitions of the word interesting. I'm have a distilled example but it takes some work and you'll want to really understand the whole object model (and I hope you like COM). EzAPI might be of some assistance in that area.

更多推荐

如何在 VB 中以编程方式编辑 SSIS 包?

本文发布于:2023-10-05 11:29:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1467360.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中以   编辑   方式   如何在   SSIS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!