Data Spliting in SSIS
yes you can do in the script component , are you using split function in C# ? or ?, please give us the code sample we can help you or use a split transformation after the script component and in the split use something like this [CODE] != " "
March 3rd, 2012 10:41am

I am using VB in script component transformation: Public Overrides Sub Input0_ProcessInput(ByVal Buffer As Input0Buffer) While Buffer.NextRow() Input0_ProcessInputRow(Buffer) If Buffer.EndOfRowset() Then ResultBuffer.SetEndOfRowset() End Sub Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer) Dim arr = Row.C3.Split(","c) ' Splitting the rows of Column3 For Each str As String In arr ResultBuffer.AddRow() 'Adding rows to the Result Buffer 'If the Column3 is not empty or Null, then set the values to the ' corresponding Result Buffer properties If Not String.IsNullOrEmpty(Row.C3) Then ResultBuffer.Column1 = Row.C1 ResultBuffer.Column2 = Row.C2 ResultBuffer.Column3 = str ResultBuffer.Column4 = Row.C4 End If End If End While
Free Windows Admin Tool Kit Click here and download it now
March 3rd, 2012 12:44pm

Thanks a alot. I am using conditional split as suggested by you and its working fine. Your help is much appreciated.
March 3rd, 2012 1:01pm

I have two tables: table1 Table 1: (SAMPLE DATA) Table 1: ID CODE 1 11,12,,13,14,,15 2 5,6,7,8,9 I am producing a flat file. The output is coming like below: 1 11 1 12 1 1 13 1 14 1 1 15 2 5 2 6 2 7 2 8 2 9 I am able to split the data in to different rows by using script component as a transformation. Is there any way i can get rid of the null value (12,,13,14,,15) Any Suggestions. Thanks
Free Windows Admin Tool Kit Click here and download it now
March 3rd, 2012 1:06pm

Split again, the technique is to redirect the rows not meeting the criteria! E.g. http://sqlblog.com/blogs/andy_leonard/archive/2010/02/11/ssis-snack-configuring-a-conditional-split.aspxArthur My Blog
March 3rd, 2012 1:56pm

In addition to the above. Please find the following; - How to: Split a Dataset by Using the Conditional Split TransformationIf you have found any of my posts helpful then please vote them as helpful. Kieran Patrick Wood MCTS BI, PGD SoftDev (Open), MBCS http://uk.linkedin.com/in/kieranpatrickwood
Free Windows Admin Tool Kit Click here and download it now
March 3rd, 2012 2:31pm

Somehow, derived column tranformation is not taking care of this issue. Is there any way we can skip this empty values in the script component transformation itself.
March 3rd, 2012 5:44pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics