Condividi tramite


ScriptComponent.PrimeOutput Method

Prepares the outputs in Script components, such as sources and transformations with asynchronous outputs, that add new rows to the output buffers.

Spazio dei nomi: Microsoft.SqlServer.Dts.Pipeline
Assembly : Microsoft.SqlServer.TxScript (in microsoft.sqlserver.txscript.dll)

Sintassi

'Dichiarazione
Public Overridable Sub PrimeOutput ( _
    Outputs As Integer, _
    OutputIDs As Integer(), _
    Buffers As PipelineBuffer() _
)
public virtual void PrimeOutput (
    int Outputs,
    int[] OutputIDs,
    PipelineBuffer[] Buffers
)
public:
virtual void PrimeOutput (
    int Outputs, 
    array<int>^ OutputIDs, 
    array<PipelineBuffer^>^ Buffers
)
public void PrimeOutput (
    int Outputs, 
    int[] OutputIDs, 
    PipelineBuffer[] Buffers
)
public function PrimeOutput (
    Outputs : int, 
    OutputIDs : int[], 
    Buffers : PipelineBuffer[]
)

Parametri

  • Outputs
    The count of the outputs of the components.
  • OutputIDs
    An array of type Integer that contains the IDs of the outputs of the components.
  • Buffers
    An array of PipelineBuffer objects that contains the output rows.

Osservazioni

The Script component developer does not use the ScriptComponent class directly, but indirectly, by coding the methods and properties of the ScriptMain class, which inherits from ScriptComponent through the UserComponent class.

Although the developer can override the PrimeOutput method, it is usually sufficient to override the CreateNewOutputRows method in the ScriptMain class to load data into the output buffers.

Esempio

The following code sample from the autogenerated ComponentWrapper project item shows how the Script component uses the PrimeOutput method in a component with two outputs.

    Public Overrides Sub PrimeOutput(ByVal Outputs As Integer, ByVal OutputIDs() As Integer, ByVal Buffers() As PipelineBuffer)

        For I As Integer = 0 To Outputs - 1
            If OutputIDs(I) = 29 Then
                Output0Buffer = New Output0Buffer(Buffers(I), GetColumnIndexes(OutputIDs(I)))
            End If
            If OutputIDs(I) = 126 Then
                Output1Buffer = New Output1Buffer(Buffers(I), GetColumnIndexes(OutputIDs(I)))
            End If
        Next

        CreateNewOutputRows()

    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

ScriptComponent Class
ScriptComponent Members
Microsoft.SqlServer.Dts.Pipeline Namespace