BulkInsertTask.InitializeTask メソッド

定義

タスクに関連付けられたプロパティを初期化します。 このメソッドはランタイムから呼び出されるメソッドであり、コードでは使用されません。

public:
 override void InitializeTask(Microsoft::SqlServer::Dts::Runtime::Connections ^ connections, Microsoft::SqlServer::Dts::Runtime::VariableDispenser ^ variableDispenser, Microsoft::SqlServer::Dts::Runtime::IDTSInfoEvents ^ events, Microsoft::SqlServer::Dts::Runtime::IDTSLogging ^ log, Microsoft::SqlServer::Dts::Runtime::EventInfos ^ eventInfos, Microsoft::SqlServer::Dts::Runtime::LogEntryInfos ^ logEntryInfos, Microsoft::SqlServer::Dts::Runtime::ObjectReferenceTracker ^ refTracker);
public override void InitializeTask (Microsoft.SqlServer.Dts.Runtime.Connections connections, Microsoft.SqlServer.Dts.Runtime.VariableDispenser variableDispenser, Microsoft.SqlServer.Dts.Runtime.IDTSInfoEvents events, Microsoft.SqlServer.Dts.Runtime.IDTSLogging log, Microsoft.SqlServer.Dts.Runtime.EventInfos eventInfos, Microsoft.SqlServer.Dts.Runtime.LogEntryInfos logEntryInfos, Microsoft.SqlServer.Dts.Runtime.ObjectReferenceTracker refTracker);
override this.InitializeTask : Microsoft.SqlServer.Dts.Runtime.Connections * Microsoft.SqlServer.Dts.Runtime.VariableDispenser * Microsoft.SqlServer.Dts.Runtime.IDTSInfoEvents * Microsoft.SqlServer.Dts.Runtime.IDTSLogging * Microsoft.SqlServer.Dts.Runtime.EventInfos * Microsoft.SqlServer.Dts.Runtime.LogEntryInfos * Microsoft.SqlServer.Dts.Runtime.ObjectReferenceTracker -> unit
Public Overrides Sub InitializeTask (connections As Connections, variableDispenser As VariableDispenser, events As IDTSInfoEvents, log As IDTSLogging, eventInfos As EventInfos, logEntryInfos As LogEntryInfos, refTracker As ObjectReferenceTracker)

パラメーター

connections
Connections

タスクで使用される接続のコレクションです。

variableDispenser
VariableDispenser

変数をロックするための VariableDispenser オブジェクトです。

events
IDTSInfoEvents

IDTSInfoEvents インターフェイスを実装するオブジェクト。

log
IDTSLogging

IDTSLogging インターフェイスを実装するオブジェクト。

eventInfos
EventInfos

タスクの実行中に発生させるイベントを含むコレクションです。

logEntryInfos
LogEntryInfos

ログ エントリのコレクションです。

refTracker
ObjectReferenceTracker

オブジェクト参照トラッカーです。

タスク開発者は、InitializeTask 基本クラスの Task メソッドをオーバーライドし、EventInfo を新規作成して、カスタム イベントを定義します。 次のコード サンプルは、2 つのカスタム イベントが作成され、コレクションに追加されるカスタム タスクのメソッドをeventInfos示していますInitializeTask

public override void InitializeTask(Connections connections, VariableDispenser variables, IDTSInfoEvents events, IDTSLogging log, EventInfos eventInfos, LogEntryInfos logEntryInfos, ObjectReferenceTracker refTracker)  
{  
    this.eventInfos = eventInfos;  
    string[] paramNames = new string[1];  
    TypeCode[] paramTypes = new TypeCode[1]{TypeCode.Int32};  
    string[] paramDescriptions = new string[1];  

    paramNames[0] = "InitialValue";  
    paramDescriptions[0] = "The value before increment.";  

    this.eventInfos.Add("OnBeforeIncrement","Fires before the task increments the value.",true,paramNames,paramTypes,paramDescriptions);  
    this.onBeforeIncrement = this.eventInfos["OnBeforeIncrement"];  

    paramDescriptions[0] = "The value after increment.";  
    this.eventInfos.Add("OnAfterIncrement","Fires after the initial value is updated.",true,paramNames, paramTypes,paramDescriptions);  
    this.onAfterIncrement = this.eventInfos["OnAfterIncrement"];  
}  

注釈

一括挿入タスクおよびその他のストック タスクの場合、このメソッドを使用して、各タスクのログ イベントを設定します。 ランタイム エンジンは、タスクが作成されるとすぐ、検証、実行、または保存操作の前に、InitializeTask を呼び出します。

適用対象