DTSEventColumnFilter.ExecutionID 字段

定义

确定是否将唯一包 GUID 添加到日志条目。

public: bool ExecutionID;
public bool ExecutionID;
val mutable ExecutionID : bool
Public ExecutionID As Boolean 

字段值

示例

下面的代码示例创建一个 Package 并为其选择一个日志提供程序。 然后,代码示例设置要包含在日志中的字段或false从日志中排除字段的字段。DTSEventColumnFiltertrue SetColumnFilter然后,定义在包产生OnError事件时记录值为true的字段。

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

namespace HttpClientConn  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            Package pkg = new Package();  
            LogProvider log1 = pkg.LogProviders.Add("DTS.LogProviderTextFile.1");  
            pkg.LoggingOptions.SelectedLogProviders.Add(log1);  
            LoggingOptions lOpts = pkg.LoggingOptions;  

            DTSEventColumnFilter ecf = new DTSEventColumnFilter();  
            // Set the detailed information to log when the event occurs.  
            // This specifies to log the Computer, Operator, and SourceName only.  
            ecf.Computer = true;  
            ecf.Operator = true;  
            ecf.SourceName = true;  
            ecf.SourceID = false;  
            ecf.ExecutionID = false;  
            ecf.MessageText = false;  
            ecf.DataBytes = false;  
            // The event is the first parameter, and the columns to log is the enumeration.   
            lOpts.SetColumnFilter("OnError", ecf);  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

Namespace HttpClientConn  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            Dim pkg As Package =  New Package()   
            Dim log1 As LogProvider =  pkg.LogProviders.Add("DTS.LogProviderTextFile.1")   
            pkg.LoggingOptions.SelectedLogProviders.Add(log1)  
            Dim lOpts As LoggingOptions =  pkg.LoggingOptions   

            Dim ecf As DTSEventColumnFilter =  New DTSEventColumnFilter()   
            ' Set the detailed information to log when the event occurs.  
            ' This specifies to log the Computer, Operator, and SourceName only.  
            ecf.Computer = True  
            ecf.Operator = True  
            ecf.SourceName = True  
            ecf.SourceID = False  
            ecf.ExecutionID = False  
            ecf.MessageText = False  
            ecf.DataBytes = False  
            ' The event is the first parameter, and the columns to log is the enumeration.   
            lOpts.SetColumnFilter("OnError", ecf)  
        End Sub  
    End Class  
End Namespace  

注解

true 将此列添加到日志条目。 由于单个包可以多次执行,因此每次运行时都会将不同的 GUID 分配给包,即唯一的执行 GUID,而不是分配给包的 GUID。

适用于