DtsContainer.ExecutionResult プロパティ

定義

DtsContainer オブジェクトの実行が成功したかどうかを示す値を返します。

public:
 property Microsoft::SqlServer::Dts::Runtime::DTSExecResult ExecutionResult { Microsoft::SqlServer::Dts::Runtime::DTSExecResult get(); };
[Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyCategory(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "PropertyCategoryExecution")]
[Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "ExecutionResultDesc")]
public Microsoft.SqlServer.Dts.Runtime.DTSExecResult ExecutionResult { get; }
[<Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyCategory(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "PropertyCategoryExecution")>]
[<Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "ExecutionResultDesc")>]
member this.ExecutionResult : Microsoft.SqlServer.Dts.Runtime.DTSExecResult
Public ReadOnly Property ExecutionResult As DTSExecResult

プロパティ値

DTSExecResult 列挙を返します。

属性

次のコード例では、既存のパッケージを実行し、そのパッケージが実行された時間をミリ秒単位で示します。 また、出力では、ExecutionResult も表示されます。

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

namespace Microsoft.SqlServer.SSIS.Samples  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            // The package is the ExecuteProcess package sample   
            // that is installed with the SSIS samples.  
            string pkg = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\bin\UsingExecuteProcess.dtsx";  

            Application app = new Application();  
            Package p1 = app.LoadPackage(pkg, null);  

            // Show the properties inherited from DtsContainer.  
            Console.WriteLine("ExecutionDuration:    {0}", p1.ExecutionDuration);  

            // Run the package, then review the execution duration.  
            p1.Execute();  
            Console.WriteLine("ExecutionDuration:    {0}", p1.ExecutionDuration);  
            // Also, review the execution result.  
            Console.WriteLine("ExecutionResult:   {0}", p1.ExecutionResult);  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

Namespace Microsoft.SqlServer.SSIS.Samples  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            ' The package is the ExecuteProcess package sample   
            ' that is installed with the SSIS samples.  
            Dim pkg As String =  "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\bin\UsingExecuteProcess.dtsx"   

            Dim app As Application =  New Application()   
            Dim p1 As Package =  app.LoadPackage(pkg,Nothing)   

            ' Show the properties inherited from DtsContainer.  
            Console.WriteLine("ExecutionDuration:    {0}", p1.ExecutionDuration)  

            ' Run the package, then review the execution duration.  
            p1.Execute()  
            Console.WriteLine("ExecutionDuration:    {0}", p1.ExecutionDuration)  
            ' Also, review the execution result.  
            Console.WriteLine("ExecutionResult:   {0}", p1.ExecutionResult)  
        End Sub  
    End Class  
End Namespace  

サンプル出力:

ExecutionDuration: 0

ExecutionDuration: 172

ExecutionResult: Success

注釈

実行結果の状態は、パッケージまたは親が失敗したかまたは成功したかの判断に加えて、パッケージ内でタスクのフローを制御するようにパッケージ内の優先順位制約を設定した場合にも重要です。 優先項目は、タスクまたはコンテナーであり、これらの実行結果によって、制約付き項目である次のタスクまたはコンテナーが実行されるかどうかが決定されます。

適用対象