次の方法で共有


Sequence.Executables プロパティ

このシーケンス コンテナーの実行中に、ランタイム エンジンによって処理された実行可能オブジェクトのコレクションを返します。 このプロパティは読み取り専用です。

名前空間:  Microsoft.SqlServer.Dts.Runtime
アセンブリ:  Microsoft.SqlServer.ManagedDTS (Microsoft.SqlServer.ManagedDTS.dll)

構文

'宣言
Public ReadOnly Property Executables As Executables 
    Get
'使用
Dim instance As Sequence 
Dim value As Executables 

value = instance.Executables
public Executables Executables { get; }
public:
virtual property Executables^ Executables {
    Executables^ get () sealed;
}
abstract Executables : Executables 
override Executables : Executables
final function get Executables () : Executables

プロパティ値

型: Microsoft.SqlServer.Dts.Runtime.Executables
Executable オブジェクトを含む Executables コレクションです。

実装

IDTSSequence.Executables

使用例

次のコード例では、Sequence オブジェクトと 3 つのタスクを作成し、各タスク間に優先順位制約を設定します。 Executables コレクションを使用して、Sequence コンテナーに含まれる実行可能オブジェクトの数を表示します。

using System;
using System.Collections.Generic;
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Tasks. FileSystemTask;

namespace Sequence_API
{
    class Program
    {
        static void Main(string[] args)
        {
            Package package = new Package();
            Sequence seq = (Sequence)package.Executables.Add("STOCK:SEQUENCE");

            // Add a File System task.
            Executable eFileTask1 = seq.Executables.Add("STOCK:FileSystemTask");
            TaskHost thFileTask1 = eFileTask1 as TaskHost;

            // Add a second File System task.
            Executable eFileTask2 = seq.Executables.Add("STOCK:FileSystemTask");
            TaskHost thFileTask2 = eFileTask2 as TaskHost;

            // Add a Bulk Insert task.
            Executable eBulkInsert = seq.Executables.Add("STOCK:BulkInsertTask");
            TaskHost thBulkInsert = eBulkInsert as TaskHost;

            // Add a precedence contraint between eFileTask1 and eFileTask2.
            // Set the constraint to be that eFileTask2 cannot run 
            // until eFileTask1 completes.
            PrecedenceConstraint pcFileTasks = seq.PrecedenceConstraints.Add(eFileTask1, eFileTask2);

            // Add another precedence contraint. Add it between eFileTask2 and BulkInsert.
            // Again, set the constraint to be that BulkInsert cannot run 
            // until eFileTask2 completes.
            PrecedenceConstraint pcFiletoBulk = seq.PrecedenceConstraints.Add(eFileTask2, eBulkInsert);
            // Obtain the precedence constraint collection, and display properties.
            // Some properties are read/write and have not been set.
            PrecedenceConstraints seqPCs = seq.PrecedenceConstraints;
            int numPCs = seqPCs.Count;
            Console.WriteLine("Number of precedence constraints in Sequence: {0}", numPCs);
            Console.WriteLine("----------------------------------------");
            
            foreach (PrecedenceConstraint pc in seqPCs)
            {
                Console.WriteLine("Constrained container  {0}", pc.ConstrainedExecutable);
                Console.WriteLine("Description            {0}", pc.Description);
                Console.WriteLine("Evaluation operation   {0}", pc.EvalOp);
                Console.WriteLine("Evaluates true         {0}", pc.EvaluatesTrue);
                Console.WriteLine("ID                     {0}", pc.ID);
                Console.WriteLine("LogicalAnd             {0}", pc.LogicalAnd);
                Console.WriteLine("Name                   {0}", pc.Name);
                Console.WriteLine("Precedence Executable  {0}", pc.PrecedenceExecutable);
                Console.WriteLine("Value                  {0}", pc.Value);
                Console.WriteLine("-----------------------------------");
            }
            Executables seqExecs = seq.Executables;
            int numExecs = seqExecs.Count;
            Console.WriteLine("Number of Executables in Sequence: {0}", numExecs);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Tasks. FileSystemTask
 
Namespace Sequence_API
    Class Program
        Shared  Sub Main(ByVal args() As String)
            Dim package As Package =  New Package() 
            Dim seq As Sequence = CType(package.Executables.Add("STOCK:SEQUENCE"), Sequence)
 
            ' Add a File System task.
            Dim eFileTask1 As Executable =  seq.Executables.Add("STOCK:FileSystemTask") 
            Dim thFileTask1 As TaskHost =  eFileTask1 as TaskHost 
 
            ' Add a second File System task.
            Dim eFileTask2 As Executable =  seq.Executables.Add("STOCK:FileSystemTask") 
            Dim thFileTask2 As TaskHost =  eFileTask2 as TaskHost 
 
            ' Add a Bulk Insert task.
            Dim eBulkInsert As Executable =  seq.Executables.Add("STOCK:BulkInsertTask") 
            Dim thBulkInsert As TaskHost =  eBulkInsert as TaskHost 
 
            ' Add a precedence contraint between eFileTask1 and eFileTask2.
            ' Set the constraint to be that eFileTask2 cannot run 
            ' until eFileTask1 completes.
            Dim pcFileTasks As PrecedenceConstraint =  seq.PrecedenceConstraints.Add(eFileTask1,eFileTask2) 
 
            ' Add another precedence contraint. Add it between eFileTask2 and BulkInsert.
            ' Again, set the constraint to be that BulkInsert cannot run 
            ' until eFileTask2 completes.
            Dim pcFiletoBulk As PrecedenceConstraint =  seq.PrecedenceConstraints.Add(eFileTask2,eBulkInsert) 
            ' Obtain the precedence constraint collection, and display properties.
            ' Some properties are read/write and have not been set.
            Dim seqPCs As PrecedenceConstraints =  seq.PrecedenceConstraints 
            Dim numPCs As Integer =  seqPCs.Count 
            Console.WriteLine("Number of precedence constraints in Sequence: {0}", numPCs)
            Console.WriteLine("----------------------------------------")
 
            Dim pc As PrecedenceConstraint
            For Each pc In seqPCs
                Console.WriteLine("Constrained container  {0}", pc.ConstrainedExecutable)
                Console.WriteLine("Description            {0}", pc.Description)
                Console.WriteLine("Evaluation operation   {0}", pc.EvalOp)
                Console.WriteLine("Evaluates true         {0}", pc.EvaluatesTrue)
                Console.WriteLine("ID                     {0}", pc.ID)
                Console.WriteLine("LogicalAnd             {0}", pc.LogicalAnd)
                Console.WriteLine("Name                   {0}", pc.Name)
                Console.WriteLine("Precedence Executable  {0}", pc.PrecedenceExecutable)
                Console.WriteLine("Value                  {0}", pc.Value)
                Console.WriteLine("-----------------------------------")
            Next
            Dim seqExecs As Executables =  seq.Executables 
            Dim numExecs As Integer =  seqExecs.Count 
            Console.WriteLine("Number of Executables in Sequence: {0}", numExecs)
        End Sub
    End Class
End Namespace

サンプル出力:

Number of precedence constraints in Sequence: 2

----------------------------------------

Constrained container Microsoft.SqlServer.Dts.Runtime.TaskHost

説明

Evaluation operation Constraint

Evaluates true True

ID {A4F5C0E6-A9A6-470D-9646-7FEAFE3B45AD}

LogicalAnd True

Name {A4F5C0E6-A9A6-470D-9646-7FEAFE3B45AD}

Precedence Executable Microsoft.SqlServer.Dts.Runtime.TaskHost

Value Success

-----------------------------------

Constrained container Microsoft.SqlServer.Dts.Runtime.TaskHost

説明

Evaluation operation Constraint

Evaluates true True

ID {665C52DE-232A-4593-ADF1-7C51949712B8}

LogicalAnd True

Name {665C52DE-232A-4593-ADF1-7C51949712B8}

Precedence Executable Microsoft.SqlServer.Dts.Runtime.TaskHost

Value Success

-----------------------------------

Number of Executables in Sequence: 3

関連項目

参照

Sequence クラス

Microsoft.SqlServer.Dts.Runtime 名前空間