Export (0) Print
Expand All

PipelineBuffer.DirectRow Method

Sends a row from a PipelineBuffer to the specified IDTSOutput100.

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

public void DirectRow(
	int outputID
)

Parameters

outputID
Type: Int32
The ID of the IDTSOutput100 where the PipelineBuffer row is sent.

The DirectRow method is called by components that contain multiple outputs in the same ExclusionGroup. It is used to direct a PipelineBuffer row to the specified output—a specific output in the component. This method can be used for error and non-error outputs, however, the DirectErrorRow method should be used to send rows to an error output.

If a component that has two synchronous outputs in the same exclusion group advances a buffer to the next row using the NextRow method without directing the row to a specific output, the row is sent to both outputs.

The following example shows a component that contains two outputs in the same exclusion group. During ProcessInput rows are sent to one or the other of the outputs by using DirectRow method.

public override void ProvideComponentProperties()
{
    IDTSInput100 input = ComponentMetaData.InputCollection.New();
    Input.Name = "DTSSampleInput";

    IDTSOutput output = ComponentMetaData.OutputCollection.New();
    output.ExclusionGroup = 1;
    output.Name = "Output1";
    output.SynchronousInputID = input.ID;

    IDTSOutput output = ComponentMetaData.OutputCollection.New();
    output.ExclusionGroup = 1;
    output.Name = "Output2";
    output.SynchronousInputID = input.ID;
}
public override void ProcessInput(int inputID, PipelineBuffer buffer)
{
    IDTSInput100 input = ComponentMetaData.InputCollection.GetObjectByID(inputID);

    IDTSOutput100 output1 = ComponentMetaData.OutputCollection[0];
    IDTSOutput100 output2 = ComponentMetaData.OutputCollection[1];

    while( buffer.NextRow())
    {
        // TODO: Insert if/then block here.
        // If criteria is met, direct the buffer row to output1.
        buffer.DirectRow(output1.ID);
        // Otherwise, direct the row to output2.
         buffer.DirectRow(output2.ID);
    }
}
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft