【问题标题】:Executing SSIS 2012 package that has script components from external application执行具有来自外部应用程序的脚本组件的 SSIS 2012 包
【发布时间】:2013-09-23 19:18:44
【问题描述】:

我正在编写一个应用程序,它将使用 Microsoft.SqlServer.ManagedDTS v 11.0 程序集执行 SSIS 2012 包。我尝试执行的包是从 SSDT-2012 设计并成功执行的,并且具有处理未正确传输的行的脚本组件。

当我尝试运行我的应用程序时,我收到每个脚本组件的错误消息:

SSIS.Pipeline:要在 SQL Server Data Tools 之外运行 SSIS 包,您必须安装 Integration Services 或更高版本的 [脚本组件名称]。

配置:使用以下 app.config 文件在 Windows 上构建适用于 x86 的应用程序:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0"/>
        <supportedRuntime version="v2.0.50727"/>
    </startup>
</configuration>

唯一相关的代码是:

using System;
using System.Data;
using System.Data.Common;
using System.IO;
using Microsoft.SqlServer.Dts.Runtime;
class MyApp
{
    public void ExecutePackage()
    {
        //Assume I have all the variables I need like packageFile, packageName, 
        //srcConnectionString, destConnectionString and eventListener etc.

        Package pkg;
        Application app;
        DTSExecResults pkgResults;

        app = new Application();
        pkg = app.LoadPackage(packageFile, eventListener);

        pkg.Variables["SrcConnectionString"].Value = srcConnectionString;
        pkg.Variables["DestConnectionString"].Value = destConnectionString;

        if (null != srcAssembly || null != destAssembly)
        {
            foreach (ConnectionManager connection in pkg.Connections)
            {
                if (null != srcAssembly && connection.Name.Contains("Source"))
                {
                    connection.SetQualifier(srcAssembly);
                }
                else if (null != destAssembly && connection.Name.Contains("Destination"))
                {
                    connection.SetQualifier(destAssembly);
                }
            }
        }

        pkgResults = pkg.Execute(null, null, eventListener, null, null);
    } 
}

有什么想法吗?

【问题讨论】:

    标签: c# ssis


    【解决方案1】:

    您没有在运行应用程序的计算机上安装 SQL Server Integration Services 服务。

    另见https://dba.stackexchange.com/questions/49786/error-to-run-a-ssis-package-outside-of-sql-server-data-tools-you-must-install

    【讨论】:

    • 这就是问题所在。谢谢!不过,这是一个荒谬的错误消息:/
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-17
    相关资源
    最近更新 更多