Condividi tramite


IDTSBufferManager90.FindColumnByLineageID Method

Gets the location, by index, of a column in a specified IDTSBuffer90 object.

Spazio dei nomi: Microsoft.SqlServer.Dts.Pipeline.Wrapper
Assembly : Microsoft.SqlServer.DTSPipelineWrap (in microsoft.sqlserver.dtspipelinewrap.dll)

Sintassi

'Dichiarazione
<DispIdAttribute(121)> _
Function FindColumnByLineageID ( _
    <InAttribute> hBufferType As Integer, _
    <InAttribute> nLineageID As Integer _
) As Integer
[DispIdAttribute(121)] 
int FindColumnByLineageID (
    [InAttribute] int hBufferType,
    [InAttribute] int nLineageID
)
[DispIdAttribute(121)] 
int FindColumnByLineageID (
    [InAttribute] int hBufferType, 
    [InAttribute] int nLineageID
)
/** @attribute DispIdAttribute(121) */ 
int FindColumnByLineageID (
    /** @attribute InAttribute() */ int hBufferType, 
    /** @attribute InAttribute() */ int nLineageID
)
DispIdAttribute(121) 
function FindColumnByLineageID (
    hBufferType : int, 
    nLineageID : int
) : int

Parametri

  • hBufferType
    The ID of the IDTSBuffer90 object that contains the column.
  • nLineageID
    The lineage ID of the column to locate in the IDTSBuffer90.

Valore restituito

An integer that indicates the location, by index, of the column in the IDTSBuffer90.

Osservazioni

This method locates the column of an IDTSInput90 or IDTSOutput90 in the specified IDTSBuffer90. This method is necessary because an instance of a buffer contains all of the IDTSOutputColumn90 objects defined in the IDTSOutputColumnCollection90 collections of the components in a graph. Components cannot rely on using the index location of its output column, or input column, as the index of that column in a buffer row. Because of this, components must use FindColumnByLineageID to locate the columns in the buffer.

Esempio

The following code example shows how a transformation component that does not have output columns uses the FindColumnByLineageID to locate its input columns in the buffer.

int[] bufferColumnIndex;
public override void PreExecute()
{
    IDTSInput90 input = ComponentMetaData.InputCollection[0];
    bufferColumnIndex = new int[BufferManager.GetColumnCount(input.Buffer)];

    for( int col=0; col < input.InputColumnCollection.Count; col++)
    {
        IDTSInputColumn90 iCol = input.InputColumnCollection[col];
        bufferColumnIndex[col] = BufferManager.FindColumnByLineageID(input.Buffer, iCol.LineageID);
    }
}
Private bufferColumnIndex As Integer() 

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

Thread Safety

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.

Piattaforme

Piattaforme di sviluppo

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Piattaforme di destinazione

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Vedere anche

Riferimento

IDTSBufferManager90 Interface
IDTSBufferManager90 Members
Microsoft.SqlServer.Dts.Pipeline.Wrapper Namespace