1
我正在运行一个脚本转换的SSIS作业。这读入文件,收集数组中的数据,并在密钥更改时从数组中输出数据。但是,这似乎并没有处理最后一个记录/数组,因为EndofRowset似乎没有被执行。这被设置为一个异步脚本转换。代码除了采摘最后的阵列组ssis endrowset没有拿起最后一行
这里是冷凝代码的所有作品..
Public Overrides Sub MyInput_ProcessInputRow(ByVal Row As MyInputBuffer)
While Row.NextRow()
Process_recs(Row.AOS, Row.Session, Row.AOSTitle, CInt(Row.ResourceHrs), CInt(Row.TotalTargetNo))
End While
If Row.EndOfRowset Then
MsgBox("LAST RECORD " & CStr(QTUT_count))
do_output_data(QTUT_count, strAOS, IntTargetplusHours, StrQTUT)
End If
End Sub
Public Sub Process_recs(ByRef subAOS As String, ByRef subSession As String, ByRef subAOStitle As String, ByRef subResourceHrs As Integer, ByVal subTotalTargetNo As Integer)
'code here collects data in an aray and sends to output on change of key
do_output_data(QTUT_count, strAOS, IntTargetplusHours, StrQTUT)
End Sub
Public Sub do_output_data(ByVal QT_count As Integer, ByVal aos() As String, ByVal hrs() As Integer, ByVal QTUT() As String)
'data moved from array and output
.AddRow()
.Group = Trim(aos(k)) + StrSuffix
.SubGroup = Trim(aos(intindex))
End Sub
Public Overrides Sub CreateNewOutputRows()
End Sub
Public Overrides Sub PostExecute()
End Sub
Public Overrides Sub PrimeOutput(ByVal Outputs As Integer, ByVal OutputIDs() As Integer, ByVal Buffers() As Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer)
MyBase.PrimeOutput(Outputs, OutputIDs, Buffers)
End Sub
非常感谢http://stackoverflow.com/users/7031230/hadi解决了我的问题。简单,当你知道如何:-) – MiguelH
很高兴提供帮助 – Hadi