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