码迷,mamicode.com
首页 > 其他好文 > 详细

ETL 脚本任务

时间:2015-09-04 14:10:59      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:

Public Sub Main()
        ‘
        ‘ Add your code here
        ‘
        Dim sbWA As New StringBuilder
        Dim i As Integer
        Dim arWA As New Collections.ArrayList
        Dim bEOF As Boolean
        For Each r As DataRow In CType(Dts.Variables("dsWOACNBR").Value, DataSet).Tables(0).Rows
            i = i + 1
            bEOF = True
            sbWA.Append("‘,‘")
            sbWA.Append(r.Item(0).ToString + r.Item(1).ToString)

            If i Mod 100 = 0 Then
                bEOF = False
                Dim strWA As String = sbWA.ToString
                strWA = strWA.Substring(3) ‘...移除"‘,‘"字符,后面计算长度时需补上

                arWA.Add(strWA)

                sbWA.Remove(0, strWA.Length + 3) ‘...清空时需补上"‘,‘"已移除字符的计数

            End If
        Next

        If bEOF = True Then
            Dim strWA As String = sbWA.ToString
            strWA = strWA.Substring(3) ‘...移除"‘,‘"字符,后面计算长度时需补上

            arWA.Add(strWA)

        End If


        Dts.Variables("arWOACNBR").Value = arWA

        Dts.TaskResult = Dts.Results.Success
    End Sub

ETL 脚本任务

标签:

原文地址:http://www.cnblogs.com/lbnnbs/p/4781556.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!