question

Mongr1l avatar image
Mongr1l asked

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 = ?
ssis
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
aRookieBIdev avatar image
aRookieBIdev answered
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() ); //Console.WriteLine(i); a = p.Executables[i].GetType().ToString(); Console.WriteLine(p.Executables[i].GetType()); } Console.ReadKey(); } } } reference link below [Reference][1] [1]: http://social.msdn.microsoft.com/Forums/pl-PL/sqlintegrationservices/thread/2d970761-40f6-45bc-9059-b886b84689af
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.