Конкатенация UDA
Imports System
Imports System.Data.Sql
Imports System.Data.SqlTypes
Imports System.Text
Imports System.IO

Public Class clr_Concat

    Private oConcatResult As StringBuilder

    Public Sub Init()
        oConcatResult = New StringBuilder()
    End Sub

    Public Sub Accumulate(ByVal value As SqlString)
        If value.IsNull Then
        End If

    End Sub

    Public Sub Merge(ByVal value As clr_Concat)
    End Sub

    Public Function Terminate() As SqlString
        If Not (oConcatResult Is Nothing) AndAlso oConcatResult.Length > 0 Then
            ? Remove the extra comma that we added.
            Return oConcatResult.ToString(0, oConcatResult.Length — 1)
            ? The value is null, so send back an empty string.
            Return New SqlString(«»)
        End If

    End Function
End Class

Поделитесь материалом с коллегами и друзьями