Condividi tramite


IDTSOutput90.ExclusionGroup Property

Gets or sets the ExclusionGroup property of an IDTSOutput90 object.

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

Sintassi

'Dichiarazione
<DispIdAttribute(101)> _
Property ExclusionGroup As Integer
[DispIdAttribute(101)] 
int ExclusionGroup { get; set; }
[DispIdAttribute(101)] 
property int ExclusionGroup {
    int get ();
    void set ([InAttribute] int plExclusionGroup);
}
/** @property */
/** @attribute DispIdAttribute(101) */ 
int get_ExclusionGroup ()

/** @property */
/** @attribute DispIdAttribute(101) */ 
void set_ExclusionGroup (/** @attribute InAttribute() */ int plExclusionGroup)
DispIdAttribute(101) 
function get ExclusionGroup () : int

DispIdAttribute(101) 
function set ExclusionGroup (plExclusionGroup : int)

Valore proprietà

The ExclusionGroup of the IDTSOutput90 object.

Osservazioni

The ExclusionGroup property is set when two outputs are synchronous to the same IDTSInput90 object and you want to direct rows exclusively to one output or to the other. The SynchronousInputID property for each output must have the same value, and the ExclusionGroup property for each output must have the same value. You must set the ExclusionGroup 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.

Esempio

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()
{
    IDTSInput90 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)
{
    IDTSInput90 input = ComponentMetaData.InputCollection.GetObjectByID(inputID);

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

    if(! buffer.EndOfRowset)
    {
        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);
        }
    }
}
Public  Overrides Sub ProvideComponentProperties() 
 Dim input As IDTSInput90 = ComponentMetaData.InputCollection.New 
 Input.Name = "DTSSampleInput" 
 Dim output As IDTSOutput = ComponentMetaData.OutputCollection.New 
 output.ExclusionGroup = 1 
 output.Name = "Output1" 
 output.SynchronousInputID = input.ID 
 Dim output As IDTSOutput = ComponentMetaData.OutputCollection.New 
 output.ExclusionGroup = 1 
 output.Name = "Output2" 
 output.SynchronousInputID = input.ID 
End Sub 

Public  Overrides Sub ProcessInput(ByVal inputID As Integer, ByVal buffer As PipelineBuffer) 
 Dim input As IDTSInput90 = ComponentMetaData.InputCollection.GetObjectByID(inputID) 
 Dim output1 As IDTSOutput90 = ComponentMetaData.OutputCollection(0) 
 Dim output2 As IDTSOutput90 = ComponentMetaData.OutputCollection(1) 
 If Not buffer.EndOfRowset Then 
   While buffer.NextRow 
     buffer.DirectRow(output1.ID) 
     buffer.DirectRow(output2.ID) 
   End While 
 End If 
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

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