次の方法で共有


DTSEventColumnFilter.ExecutionID フィールド

一意のパッケージ GUID をログ エントリに追加するかどうかを決定します。

名前空間:  Microsoft.SqlServer.Dts.Runtime
アセンブリ:  Microsoft.SqlServer.ManagedDTS (Microsoft.SqlServer.ManagedDTS.dll)

構文

'宣言
Public ExecutionID As Boolean
'使用
Dim instance As DTSEventColumnFilter 
Dim value As Boolean 

value = instance.ExecutionID 

instance.ExecutionID = value
public bool ExecutionID
public:
bool ExecutionID
val mutable ExecutionID: bool
public var ExecutionID : boolean

説明

true を指定すると、この列がログ エントリに追加されます。 同じパッケージが何度も実行される可能性があるため、実行するたびに異なる GUID がパッケージに割り当てられます。この一意の実行 GUID は、パッケージに割り当てられている GUID とは異なります。

使用例

次のコード例では、Package を作成し、ログ プロバイダーを選択します。 コード例では次に、DTSEventColumnFilter フィールドをログに含める場合はこのフィールドを true に設定し、ログから除外する場合は false に設定します。 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

関連項目

参照

DTSEventColumnFilter 構造体

Microsoft.SqlServer.Dts.Runtime 名前空間