Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DtsContainer.ExecutionResult Property

Returns a value that indicates the success or failure of the execution of the DtsContainer object.

Namespace:  Microsoft.SqlServer.Dts.Runtime
Assembly:  Microsoft.SqlServer.ManagedDTS (in Microsoft.SqlServer.ManagedDTS.dll)
public DTSExecResult ExecutionResult { get; }

Property Value

Type: Microsoft.SqlServer.Dts.Runtime.DTSExecResult
Returns a DTSExecResult enumeration.

In addition to determining if the package or parent fails or succeeds, the execution result status is important when you have precedence constraints set in the package to control the flow of the tasks in the package. The precedence item is the task or container whose execution outcome determines whether the next task or container, the constrained item, runs.

The following code example runs an existing package, then shows how long the package ran, in milliseconds. The output also displays the 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);
        }
    }
}

Sample Output:

ExecutionDuration: 0

ExecutionDuration: 172

ExecutionResult: Success

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.