Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Executing SSIS 2012 package that has script components from external application

Tags:

c#

ssis

I'm writing an application that will execute an SSIS 2012 package using the Microsoft.SqlServer.ManagedDTS v 11.0 assembly. The package that I'm trying to execute was designed and successfully executed from SSDT-2012, and has script components that handle rows that don't transfer correctly.

When I try to run my application I get the error message for each of my script components:

SSIS.Pipeline: To run a SSIS package outside of SQL Server Data Tools you must install [Script Component Name] of Integration Services or higher.

Configuration: Building application for x86 on Windows with the following app.config file:

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

The only relevant code is:

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);
    } 
}

Any ideas?

like image 339
Maria Avatar asked Sep 18 '13 20:09

Maria


People also ask

How do I use script component as destination in SSIS?

Configuring SSIS Script Component as Destination STEP 1: Drag and drop the Data Flow Task from the toolbox to control flow region. Next, rename it as the SSIS Script Component as Destination. Double click on the data flow task will open the data flow tab. STEP 3: Click on the columns tab to verify the columns.

Which of the following Cannot be used to run an SSIS package?

You cannot use a SQL Account to run an SSIS package in the Integration Services Catalog.

What is the difference between script task and script component in SSIS?

The Script task is configured on the Control Flow tab of the designer and runs outside the data flow of the package. The Script component is configured on the Data Flow page of the designer and represents a source, transformation, or destination in the Data Flow task.

Which task can be used to execute a package inside one more package?

The Execute Package task can run child packages that are contained in the same project that contains the parent package.


1 Answers

You do not have the SQL Server Integration Services Service installed on the machine the application is running from.

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

like image 107
billinkc Avatar answered Oct 20 '22 08:10

billinkc