Classe ScriptBuffer

Serves as the base class for the read-only classes representing the input and the outputs that are generated by the Script component in the BufferWrapper project item in a Script component project.

Hiérarchie d'héritage

System. . :: . .Object
  Microsoft.SqlServer.Dts.Pipeline..::..ScriptBuffer

Espace de noms :  Microsoft.SqlServer.Dts.Pipeline
Assembly :  Microsoft.SqlServer.TxScript (en Microsoft.SqlServer.TxScript.dll)

Syntaxe

'Déclaration
Public Class ScriptBuffer
'Utilisation
Dim instance As ScriptBuffer
public class ScriptBuffer
public ref class ScriptBuffer
type ScriptBuffer =  class end
public class ScriptBuffer

Le type ScriptBuffer expose les membres suivants.

Constructeurs

  Nom Description
Méthode publique ScriptBuffer Initializes a new instance of the ScriptBuffer class.

Haut de la page

Propriétés

  Nom Description
Propriété protégée Item Gets or sets the value of a column in the buffer by using its index in the array of buffer column indexes.

Haut de la page

Méthodes

  Nom Description
Méthode protégée AddRow Adds an empty new row to the data flow buffer.
Méthode protégée DirectRow Directs a row to the specified output when a component has more than one available output.
Méthode protégée EndOfRowset Returns a value that indicates whether the end of the rows in a buffer has been reached.
Méthode publique Equals (hérité de Object.)
Méthode protégée Finalize (hérité de Object.)
Méthode publique GetHashCode (hérité de Object.)
Méthode publique GetType (hérité de Object.)
Méthode protégée IsNull Returns a value that indicates whether the value of the specified column is nullNothingnullptrunitune référence Null (Nothing dans Visual Basic).
Méthode protégée MemberwiseClone (hérité de Object.)
Méthode protégée NextRow Tries to move to the next available row in the buffer and returns a value that indicates whether another row was available.
Méthode protégée SetEndOfRowset Indicates to the data flow that no more rows will be added to the output buffer.
Méthode protégée SetNull Makes the value of the specified column nullNothingnullptrunitune référence Null (Nothing dans Visual Basic).
Méthode publique ToString (hérité de Object.)

Haut de la page

Champs

  Nom Description
Champ protégé Buffer
Champ protégé BufferColumnIndexes An array of column indexes.

Haut de la page

Notes

The ScriptBuffer class serves as the base class for the read-only classes representing the input and the outputs that are generated by the Script component in the BufferWrapper project item in a Script component project. The classes in the BufferWrapper project item provide the developer with a set of methods for working with the data flow buffers, as well as typed accessor properties for each column in the buffers.

The Script component developer does not use the ScriptBuffer class directly, but indirectly, through the derived classes in the BufferWrapper project item that represent the component's input and outputs.

For more information, see Codage et débogage du composant Script and Présentation du modèle objet du composant Script.

Exemples

The following code sample from Création d'une transformation asynchrone à l'aide du composant Script demonstrates several methods and properties of the ScriptBuffer class, including AddRow, NextRow, EndOfRowset, and SetEndOfRowset.

Public Class ScriptMain
    Inherits UserComponent

    Private myRedmondAddressCount As Integer

    Public Overrides Sub CreateNewOutputRows()

        MySummaryOutputBuffer.AddRow()

    End Sub

    Public Overrides Sub MyAddressInput_ProcessInput(ByVal Buffer As MyAddressInputBuffer)

        While Buffer.NextRow()
            MyAddressInput_ProcessInputRow(Buffer)
        End While

        If Buffer.EndOfRowset Then
            MyAddressOutputBuffer.SetEndOfRowset()
            MySummaryOutputBuffer.MyRedmondCount = myRedmondAddressCount
            MySummaryOutputBuffer.SetEndOfRowset()
        End If

    End Sub

    Public Overrides Sub MyAddressInput_ProcessInputRow(ByVal Row As MyAddressInputBuffer)

        With MyAddressOutputBuffer
            .AddRow()
            .AddressID = Row.AddressID
            .City = Row.City
        End With

        If Row.City.ToUpper = "REDMOND" Then
            myRedmondAddressCount += 1
        End If

    End Sub

End Class

Sécurité des threads

Tous les membres publics static (Shared dans Visual Basic) de ce type sont thread-safe. Tous les membres de l'instance ne sont pas garantis comme étant thread-safe.