Package.Executables Property
SQL Server 2005
Returns the collection of executable objects contained within the package that are a part of the package workflow.
Namespace: Microsoft.SqlServer.Dts.Runtime
Assembly: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)
Assembly: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)
The following code example adds the Bulk Insert task as an executable to the package, then creates the Executables collection and iterates over it, displaying the CreationName.
using System; using System.Collections.Generic; using System.Text; using Microsoft.SqlServer.Dts.Runtime; namespace Executables_API { class Program { static void Main(string[] args) { Package pkg = new Package(); Executable exec = pkg.Executables.Add("STOCK:BulkInsertTask"); // Obtain the collection. Executables pgkExecs = pkg.Executables; foreach (Executable eachExec in pgkExecs) { TaskHost th = exec as TaskHost; Console.WriteLine("Executable creation name is: {0}", th.CreationName); } // Show that at least one executable exists. if (pgkExecs.Contains(0)) { Console.WriteLine("Contains returned true"); } else { Console.WriteLine("Contains returned false"); } } } }
Sample Output:
Executable creation name is: Microsoft.SqlServer.Dts.Tasks.BulkInsertTask.BulkInsertTask, Microsoft.SqlServer.BulkInsertTask, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91
Contains returned true
Development Platforms
For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.Target Platforms
For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.