我的索引超出了以下腳本的界限錯誤。我有1個輸入列和11個輸出列添加到SSIS腳本組件。所有這些數據類型都是字符串。不知道我哪裏錯了。 在此先感謝。索引在VB.NET腳本中出現了界限錯誤
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
Dim strRow As String
Dim strColSeperator As String
Dim rowValues As String()
strRow = Row.Line.ToString()
If strRow.Contains("-") Then
strColSeperator = ("-")
ElseIf strRow.Contains(";") Then
strColSeperator = ";"
End If
rowValues = Row.Line.Split(CChar(strColSeperator))
Row.Invoices = rowValues.GetValue(0).ToString()
Row.Detail = rowValues.GetValue(1).ToString()
Row.Date = rowValues.GetValue(2).ToString()
Row.Something1 = rowValues.GetValue(3).ToString()
Row.Something2 = rowValues.GetValue(4).ToString()
Row.SomeNumber = rowValues.GetValue(5).ToString()
Row.CustomerName = rowValues.GetValue(6).ToString()
Row.InvoiceNumber = rowValues.GetValue(7).ToString()
Row.InvoiceNumber2 = rowValues.GetValue(8).ToString()
Row.InvoiceNumber3 = rowValues.GetValue(9).ToString()
Row.InvoiceNumber4 = rowValues.GetValue(10).ToString()
End Sub
美元餃子你已經在那裏了臭鼬數據。在您的腳本轉換中,添加第二個輸出(輸出1)以捕捉違規行。向輸出1添加一列,列名稱與現有數據類型匹配。將上面的代碼包裝在try/catch塊中。在catch部分中,添加這兩行'Output1Buffer.AddRow()'和'Output1Buffer.Line = Row.Line'將這些行引入文件或添加數據查看器,並查看爲什麼它無法分裂爲預期大小。 – billinkc