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.

命名空间: Microsoft.SqlServer.Dts.Pipeline
程序集: Microsoft.SqlServer.TxScript (in microsoft.sqlserver.txscript.dll)

语法

声明
<DefaultMemberAttribute("Item")> _
Public Class ScriptBuffer
[DefaultMemberAttribute("Item")] 
public class ScriptBuffer
[DefaultMemberAttribute(L"Item")] 
public ref class ScriptBuffer
/** @attribute DefaultMemberAttribute("Item") */ 
public class ScriptBuffer
DefaultMemberAttribute("Item") 
public class ScriptBuffer

备注

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 Coding and Debugging the Script Component and Understanding the Script Component Object Model.

Inheritance Hierarchy

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

示例

The following code sample from Creating an Asynchronous Transformation with the Script Component 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

线程安全

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.

平台

开发平台

有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。

目标平台

有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。

请参阅

参考

ScriptBuffer Members
Microsoft.SqlServer.Dts.Pipeline Namespace