Script component seems to not writing the records
Hi, I do have the following code in similar, Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer) Try Dim Vals() As String = Strings.Split(Row.Column0, " , ", , CompareMethod.Text) Dim ColumnCount As Integer = Strings.Split(Row.Column0, " , ", , CompareMethod.Text).Length Select Case ColumnCount Case Is = 11 With MatchingBuffer .AddRow() .Col1 = Vals(0) .Col2 = Vals(1) .Col3 = Vals(2) .Col4 = Vals(3) .Col5 = Vals(4) .Col6 = Vals(5) .Col7 = Vals(6) .Col8 = Vals(7) .Col9 = Vals(8) .Col10 = Vals(9) .Col11 = Vals(10) .Col12 = Vals(11) End With End Select Catch ex As Exception End Try End Sub But however the values are not written to the flat file after some columns, Like From col9 though there are values with the source its writing only 'Null' as the value.. i've checked with the size of input and output columns. both are correct. But the values alone are not written to the destination. please advice ! Thanks !--------------------------- Radhai Krish | Golden Age is no more far | --------------------------
October 3rd, 2012 3:02am

1) Just to make sure.... is the mapping in flat file destination correct (did't forgot any lines). If so add a data viewe behind your Script Component to check if the columns are filled. 2) Which version of SSIS are you using? 2012 has a debug option (for 2005 and 2008 it's harder)Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
Free Windows Admin Tool Kit Click here and download it now
October 3rd, 2012 4:07am

1) Just to make sure.... is the mapping in flat file destination correct (did't forgot any lines). If so add a data viewe behind your Script Component to check if the columns are filled. 2) Which version of SSIS are you using? 2012 has a debug option (for 2005 and 2008 it's harder)Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
October 3rd, 2012 4:12am

1) Just to make sure.... is the mapping in flat file destination correct (did't forgot any lines). If so add a data viewe behind your Script Component to check if the columns are filled. 2) Which version of SSIS are you using? 2012 has a debug option (for 2005 and 2008 it's harder) Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter Hi Joost, Thanks for ur reply . The input Flat file for script component contains a single column into which all my columns are combined to one column. later with script component i am again separating the data into separate columns. I did checked with data viewers too there only i find this mismatching happening with script component, like, Column0 Emp#_0001 Test_00000003 1000 O Employee Emp#_0002 Test_00000007 1000 O Employee Emp#_0003 Test_00000011 1000 O Employee Emp#_0004 Test_00000014 1000 O Employee Here it has to separate like the below Col1 | Col2 | Col3 | Col4 Emp#_0001 | Test_00000003 | 1000 | O Employee Emp#_0002 | Test_00000007 | 1000 | O Employee Emp#_0003 | Test_00000011 | 1000 | O Employee Emp#_0004 | Test_00000014 | 1000 | O Employee but in the next data viewer its like the below, Col1 | Col2 | Col3 | Col4 Emp#_0001 | Test_00000003 | O Employee | Emp#_0002 | Test_00000007 | O Employee | Emp#_0003 | Test_00000011 | O Employee | Emp#_0004 | Test_00000014 | O Employee | The value 1000 is not appearing in the result. its an example only the rest of columns are all with 'Null' values totally more than 50 cols are there. I am using SQL 2008 R2. how can i debug in R2 version if available ? i dont know how this script component is behaving like this. All the columns are in varchar type only with varying size. --------------------------- Radhai Krish | Golden Age is no more far | --------------------------
Free Windows Admin Tool Kit Click here and download it now
October 3rd, 2012 4:30am

You're splitting on a comma (and some spaces around it) Strings.Split(Row.Column0, " , ", , CompareMethod.Text) , but I don't see commas in your string: Emp#_0001 Test_00000003 1000 Non-Union Employee 2008 doesn't support debug, but there are some 'workarounds': http://microsoft-ssis.blogspot.com/2011/04/breakpoint-does-not-work-within-ssis.htmlPlease mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
October 3rd, 2012 4:37am

hanks again Joost ! I am switching between delimiters as i thought the issue was due to it, only so the confusion in my previous code. Now i am using the delimiter as 4 spaces i.e. (' ') before the script component, after script component, the script code is Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer) Try Dim Vals() As String = Strings.Split(Row.Column0, " ", , CompareMethod.Text) Dim ColumnCount As Integer = Strings.Split(Row.Column0, " ", , CompareMethod.Text).Length Select Case ColumnCount Case Is = 5 With MatchingBuffer .AddRow() .Col1 = Vals(0) .Col2 = Vals(1) .Col3 = Vals(2) .Col4 = Vals(3) .Col5 = Vals(4) End With End Select Catch ex As Exception End Try End Sub will there be any issue due to data type ? or the above code ?? please let me know. --------------------------- Radhai Krish | Golden Age is no more far | --------------------------
Free Windows Admin Tool Kit Click here and download it now
October 3rd, 2012 5:17am

It's working for me... (2012 example) Imports System Imports System.Data Imports System.Math Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper Imports Microsoft.SqlServer.Dts.Runtime.Wrapper <Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute()> _ <CLSCompliant(False)> _ Public Class ScriptMain Inherits UserComponent Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer) Try Dim Vals() As String = Strings.Split(Row.myBigColumn, " ", , CompareMethod.Text) Dim ColumnCount As Integer = Vals.Length Select Case ColumnCount Case Is = 5 With MatchingBufferBuffer .AddRow() .col1 = Vals(0) .col2 = Vals(1) .col3 = Vals(2) .col4 = Vals(3) End With End Select Catch ex As Exception End Try End Sub End Class Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
October 3rd, 2012 6:00am

1) Just to make sure.... is the mapping in flat file destination correct (did't forgot any lines). If so add a data viewe behind your Script Component to check if the columns are filled. 2) Which version of SSIS are you using? 2012 has a debug option (for 2005 and 2008 it's harder) Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter Yes i missed a column mapping.. THough i checked many times i dint notice that .. finally ur point helped me here .. Thanks a lot !--------------------------- Radhai Krish | Golden Age is no more far | --------------------------
Free Windows Admin Tool Kit Click here and download it now
October 3rd, 2012 6:39am

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

Other recent topics Other recent topics