J'ai l'index était hors des limites d'erreur pour le script suivant. J'ai 1 colonne d'entrée et 11 colonnes de sortie ajoutées au composant Script SSIS. Les types de données pour tous sont des chaînes. Je ne sais pas où je vais mal. Merci d'avance.l'index était hors limites erreur dans le script 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
dollars aux boulettes que vous avez données skunkesques là-dedans. Sur votre transformation Script, ajoutez une deuxième sortie (Sortie 1) pour intercepter les lignes en conflit. Ajouter une colonne à la sortie 1, nom de la colonne Ligne correspondant au type de données existant. Enveloppez le code ci-dessus dans un bloc try/catch. Dans la partie catch, ajoutez ces deux lignes 'Output1Buffer.AddRow()' et 'Output1Buffer.Line = Row.Line' Dirigez-les dans le fichier ou ajoutez un visualiseur de données et voyez pourquoi il ne parvient pas à se diviser en taille attendue. – billinkc