SSIS - Referencing This Package in Script

I have an SSIS Package. I need to write a VB.NET (or C#) script task inside the pkg that looks at a specific Sequence Container in the same SSIS Package, cycles through all the executables and stores the names of those executables into an ADO recordset for later use.

I'm stuck on the first step: How do I reference the SSIs pkg from inside?

 Dim pkg as Package
 pkg = ?
more ▼

asked Sep 14, 2012 at 04:54 PM in Default

avatar image

0 1 1 1

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

hi ,

you need to read the package from where it is saved.

using System;

using System.Collections.Generic;

using System.Text;

using Microsoft.SqlServer.Dts.Pipeline.Wrapper;

using Microsoft.SqlServer.Dts.Runtime;

using Microsoft.SqlServer.Dts.Tasks;

namespace PROFILE


class Program


 static void Main(string[] args)
   Application app = new Application();

   string a;
   Package p;

   TaskHost t;

   p = new Package();

   p = app.LoadPackage("C:\\Visual Studio 2005\\PROFILE.dtsx", null);

   for (int i = 0; i < p.Executables.Count; i++)

     Console.WriteLine("Component : " + p.Executables[i].ToString() );

     a = p.Executables[i].GetType().ToString();




reference link below Reference

more ▼

answered Sep 25, 2012 at 06:25 AM

avatar image

2.8k 56 65 71

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Sep 14, 2012 at 04:54 PM

Seen: 710 times

Last Updated: Sep 25, 2012 at 06:30 AM

Copyright 2018 Redgate Software. Privacy Policy