在C#中以编程方式加载SSIS包 [英] Loading SSIS Package Programmatically in C#

查看:98
本文介绍了在C#中以编程方式加载SSIS包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从我的应用程序加载一个ssis程序包,效果很好。但是,我要尝试解决的却是失败的原因是该程序包在1秒钟内执行(这很棒),但是加载程序包需要9秒钟。

I'm loading a ssis package from my application which works fine. However, what I'm trying to work out and failing miserably is that the package executes in 1 second (which is great) but the loading of the package takes 9 seconds.

在Visual Studio 2015中本地工作,远程连接到SQL Server 2014实例。

Working locally in visual studio 2015 connecting remotely to a SQL Server 2014 instance.

正在加载程序包

这里的代码(标准内容)...

Heres the code (standard stuff)...

Application application = new Application();
DTSExecResult result;
DTSPackageEventListener eventListener = new DTSPackageEventListener();

packageLocation = request.packageLocation;

//using (Package package = application.LoadPackage(packageLocation, eventListener)) // 9 seconds to load
using (Package package = application.LoadFromDtsServer(@"File System\<PACKAGENAME>", @"<SERVERNAME>", eventListener)) // 9 seconds to load
{
.
.
.

有人有什么建议吗?任何帮助/指导将不胜感激。

Does anyone have any tips? Any help/guidance would be much appreciated.

Simon。

推荐答案

这是正常现象,dtsx文件是一个xml文件,DtsRuntime库需要反序列化该文件才能将其作为点网类加载。另外,在装入程序包时还需要进行一些验证。

This is normal, dtsx file is an xml file and the DtsRuntime library need to deserialize the file to load it as dot net class. Also there are some validation that are done on package loading.

这篇关于在C#中以编程方式加载SSIS包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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