Compartir a través de


DtsContainer.ExecutionDuration Propiedad

Definición

Devuelve un valor que indica la cantidad de tiempo, en milisegundos, que el contenedor invirtió en la ejecución. Esta propiedad es de sólo lectura.

public:
 property int ExecutionDuration { int 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), "ExecutionDurationDesc")]
public int ExecutionDuration { 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), "ExecutionDurationDesc")>]
member this.ExecutionDuration : int
Public ReadOnly Property ExecutionDuration As Integer

Valor de propiedad

Entero que contiene el tiempo que el contenedor ha dedicado a ejecutar. El tiempo se proporciona en milisegundos.

Implementaciones

Atributos

Ejemplos

En el ejemplo de código siguiente se ejecuta un paquete existente y, a continuación, se muestra cuánto tiempo se ejecutó el paquete, en milisegundos. La salida también muestra .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  

Salida del ejemplo:

ExecutionDuration: 0

ExecutionDuration: 172

ExecutionResult: Correcto

Se aplica a