Share via


PipelineComponent.PreExecute Method

Called after PrepareForExecute, and before PrimeOutput and ProcessInput.

네임스페이스: Microsoft.SqlServer.Dts.Pipeline
어셈블리: Microsoft.SqlServer.PipelineHost (in microsoft.sqlserver.pipelinehost.dll)

구문

‘선언
Public Overridable Sub PreExecute
public virtual void PreExecute ()
public:
virtual void PreExecute ()
public void PreExecute ()
public function PreExecute ()

주의

Component developers should factor as much functionality into PreExecute as possible because it is called one time per component instead of one time per buffer for ProcessInput. Components should locate the indexes of its input and output columns in the PipelineBuffer by calling the FindColumnByLineageID method of the BufferManager.

The following example shows how to locate the column indexes of the columns in the InputColumnCollection. They are stored in a local variable and then used in ProcessInput to access the columns in the PipelineBuffer.

int[] bufferColumnIndex;
public override void PreExecute()
{
    IDTSInput90 input = ComponentMetaData.InputCollection[0];
    bufferColumnIndex = new int[input.InputColumnCollection.Count];
    for ( int x=0; x < input.InputColumnCollection.Count; x++)
    {
        bufferColumnIndex[x] = BufferManager.FindColumnByLineageID( input.Buffer, input.InputColumnCollection[x].LineageID);
    }
}
public override void ProcessInput( int inputID, PipelineBuffer buffer )
{
    if( !buffer.EndOfRowset)
    {
        while( buffer.NextRow() )
        {
            for( int x=0; x < bufferColumnIndex.Length(); x++ )
            {
                if( !buffer.IsNull(bufferColumnIndex[x]))
                {
                    // TODO: Access the column data.
                }
            }
        }
    }
}
Private bufferColumnIndex As Integer() 

Public Overrides Sub PreExecute() 
 Dim input As IDTSInput90 = ComponentMetaData.InputCollection(0) 
 bufferColumnIndex = New Integer(input.InputColumnCollection.Count - 1) {} 
 Dim x As Integer = 0 
 While x < input.InputColumnCollection.Count
   bufferColumnIndex(x) = BufferManager.FindColumnByLineageID(input.Buffer, input.InputColumnCollection(x).LineageID) 
   x -= 1
 End While 
End Sub 

Public Overrides Sub ProcessInput(ByVal inputID As Integer, ByVal buffer As PipelineBuffer) 
 If Not buffer.EndOfRowset Then 
   While buffer.NextRow 
     Dim x As Integer = 0 
     While x < bufferColumnIndex.Length 
       If Not buffer.IsNull(bufferColumnIndex(x)) Then 
       End If 
       x -= 1
     End While 
   End While 
 End If 
End Sub

스레드 보안

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.

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

PipelineComponent Class
PipelineComponent Members
Microsoft.SqlServer.Dts.Pipeline Namespace