DtsContainer.ExecutionResult Property
Returns a value that indicates the success or failure of the execution of the DtsContainer object.
Пространство имен: Microsoft.SqlServer.Dts.Runtime
Сборка: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)
Синтаксис
'Декларация
Public ReadOnly Property ExecutionResult As DTSExecResult
public DTSExecResult ExecutionResult { get; }
public:
property DTSExecResult ExecutionResult {
DTSExecResult get ();
}
/** @property */
public DTSExecResult get_ExecutionResult ()
public function get ExecutionResult () : 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\90\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\90\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
Sample Output:
ExecutionDuration: 0
ExecutionDuration: 172
ExecutionResult: Success
Синхронизация потоков
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Платформы
Платформы разработки
Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.
Целевые платформы
Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.
См. также
Справочник
DtsContainer Class
DtsContainer Members
Microsoft.SqlServer.Dts.Runtime Namespace