Adding a new row in Script Component__
Hi Guys, I have a situation that i need to add a new row using Script Component. For Example: I have a LkpTable MProductCode | MCProductCode | Desc VMRYC | RYC | S And on my resultset I have ProductParentCode | ProductCode | Desc VMRYC | VMRYC | M VMRYC | VMJFFL | MC VMRYC | VMCOKE | MC My goal is to add new row that would look like these, and change the DESC value to 'MC' ParentProductCode | ProductCode | Desc VMRYC | VMRYC | M VMRYC | VMJFFL | MC VMRYC | VMCOKE | MC VMRYC | RYC | MC Thanks,
January 29th, 2011 10:42pm

Don't know understand what you want but this is Script Component code to add a row: Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer) Me.Output0Buffer.AddRow ' Add a new record Me.Output0Buffer.ParentProductCode = "somevalue" Me.Output0Buffer.ProductCode = "somevalue" Me.Output0Buffer.Desc = "somevalue" End Sub Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
January 30th, 2011 2:45am

Don't know I understand what you want but this is Script Component code to add a row: Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer) Me.Output0Buffer.AddRow ' Add a new record Me.Output0Buffer.ParentProductCode = "somevalue" Me.Output0Buffer.ProductCode = "somevalue" Me.Output0Buffer.Desc = "somevalue" End Sub Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com
January 30th, 2011 2:45am

Don't know I understand what you want but this is Script Component code to add a row: Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer) Me.Output0Buffer.AddRow ' Add a new record Me.Output0Buffer.ParentProductCode = "somevalue" Me.Output0Buffer.ProductCode = "somevalue" Me.Output0Buffer.Desc = "somevalue" End Sub Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
January 30th, 2011 2:45am

Hi Guys, Maybe I am not clear to my question. Anyway, I needed to add a new row from the lookup table. For example, I have 3 rows of data from a flat file, I will add 1 rows that is coming from a table outside of the ssis using script component. So from the original 3 rows that i have it will become 4 rows on the datasets. Thanks,
January 30th, 2011 10:15am

In order to do this, your script component needs to be asynchronous. Asynchronous scripts are harder to use than synchronous scripts - you need to specify the output column metadata manually as opposed to having it inherited from the input, and you need to specifically generate ALL of the output rows as opposed to them being passed through. My recommendation is that you attempt to use standard SSIS components to achieve your desired effect. What you have described is not what I'd call a "lookup" scenario. It appears to be adding new rows to your dataset rather than looking up new values to place on existing rows. If you can explain the conditions that would cause you to "union" rows from this "lookup table" to your dataset, I may be able to assist more. Talk to me now on
Free Windows Admin Tool Kit Click here and download it now
February 2nd, 2011 12:00pm

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

Other recent topics Other recent topics