Export (0) Print
Expand All

IDTSOutput100.ExclusionGroup Property

Gets or sets the ExclusionGroup property of an IDTSOutput100 object.

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

[DispIdAttribute()]
int ExclusionGroup { get; set; }

Property Value

Type: Int32
The ExclusionGroup of the IDTSOutput100 object.

The ExclusionGroup property is set when two outputs are synchronous to the same IDTSInput100 object and you want to direct rows exclusively to one output or to the other. Both outputs must have the same value for their SynchronousInputID properties and for their ExclusionGroup properties. You must set this property to a nonzero value if you want to use an exclusion group; otherwise, leave the default value of zero.

During execution, data flow components that have multiple outputs with the same synchronous input and the same nonzero exclusion group direct rows from the input PipelineBuffer to one of the outputs using the DirectRow method, or, when the IsErrorOut property is true, the DirectErrorRow method.

The following code example demonstrates how the ExclusionGroup property is used when a data flow component has two outputs in the same exclusion group and the same synchronous input.

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())
    {
        // 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