Export (0) Print
Expand All

IDTSBufferManager100.FindColumnByLineageID Method

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

Namespace:  Microsoft.SqlServer.Dts.Pipeline.Wrapper
Assembly:  Microsoft.SqlServer.DTSPipelineWrap (in Microsoft.SqlServer.DTSPipelineWrap.dll)

[DispIdAttribute()]
int FindColumnByLineageID(
	int hBufferType,
	int nLineageID
)

Parameters

hBufferType
Type: Int32
The ID of the IDTSBuffer100 object that contains the column.
nLineageID
Type: Int32
The lineage ID of the column to locate in the IDTSBuffer100.

Return Value

Type: Int32
An integer that indicates the location, by index, of the column in the IDTSBuffer100.

This method locates the column of an IDTSInput100 or IDTSOutput100 in the specified IDTSBuffer100. This method is necessary because an instance of a buffer contains all of the IDTSOutputColumn100 objects defined in the IDTSOutputColumnCollection100 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.

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()
{
    IDTSInput100 input = ComponentMetaData.InputCollection[0];
    bufferColumnIndex = new int[BufferManager.GetColumnCount(input.Buffer)];

    for( int col=0; col < input.InputColumnCollection.Count; col++)
    {
        IDTSInputColumn100 iCol = input.InputColumnCollection[col];
        bufferColumnIndex[col] = BufferManager.FindColumnByLineageID(input.Buffer, iCol.LineageID);
    }
}
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft