Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Using the Script Component With Multiple Outputs Expand / Collapse
Author
Message
Posted Wednesday, April 15, 2009 12:06 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 4:46 PM
Points: 1,045, Visits: 2,725
Comments posted to this topic are about the item Using the Script Component With Multiple Outputs



Tim Mitchell, SQL Server MVP
Independent Business Intelligence Consultant
www.TimMitchell.net
@Tim_Mitchell

Post #697265
Posted Wednesday, April 15, 2009 1:56 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, March 31, 2014 1:03 AM
Points: 215, Visits: 428
Thanks for this tip. You have explained it really well in an easy to understand manner.

Girish
Post #697297
Posted Wednesday, April 15, 2009 6:19 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:20 PM
Points: 11,305, Visits: 13,094
Great article Tim. I don't currently have to work with anything like this, but it is a good overview of using the Script Component in addition to the tutorial on managing an indefinite flat file source.



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #697438
Posted Wednesday, April 15, 2009 9:40 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 8, 2013 8:56 AM
Points: 2, Visits: 26
I agree with the solution but i would recommend another approach which is simpler and doesn't require any script component.
You can use conditional split to split the source data based on record type and have multiple destination for each record type.

Post #697657
Posted Wednesday, April 15, 2009 10:37 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 4:46 PM
Points: 1,045, Visits: 2,725
You're right that the conditional split could be used in some cases, but when you have outputs with differing numbers of columns, the script component would be ideal.



Tim Mitchell, SQL Server MVP
Independent Business Intelligence Consultant
www.TimMitchell.net
@Tim_Mitchell

Post #697721
Posted Wednesday, April 15, 2009 12:50 PM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 1:05 PM
Points: 4,390, Visits: 9,534
And what about the case when you have information in the header record that needs to be associated with the detail records? For example, if we have an employer group in the header record - and the detail records are the list of employees for the group.

I have worked with files where the group identifier only exists in the header record, but we need that identifier for each detail record.

I don't think that can be done with a conditional split - and using a script component will work handily.


Jeffrey Williams
Problems are opportunites brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs
Post #697825
Posted Sunday, April 19, 2009 4:47 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Yesterday @ 3:24 PM
Points: 536, Visits: 762
Thank you for the article! I have been doing a lot of SSIS work over the last 3-4 years including some pretty advanced stuff, but have never touched Script component. Your article made it look much less scary . I am sure I will use these techniques sometime soon.


Post #700290
Posted Thursday, April 23, 2009 9:29 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Wednesday, September 3, 2014 7:24 AM
Points: 761, Visits: 428
This is a good article for how to use a compenent that is very badly documented in Books Online and everywhere else. I used the Script Component transformation to "condense" a table that i could see was possible any other way. It took a lot of searching to find how to overwrite the appropriate subroutines and output to a new buffer, whch could subsequently be put into a table. I think that when there is a lack of documentation in this way people just don't use the component as they don't really know what it is for, which is a shame as it has its uses.


Post #703329
Posted Thursday, May 21, 2009 9:58 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, February 14, 2013 1:05 PM
Points: 103, Visits: 133
So whats the right approach when we have records in the header as opposed to not having them in details?
Post #721470
Posted Thursday, August 5, 2010 1:37 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, September 16, 2010 10:41 AM
Points: 1, Visits: 4
Can I have the same example shown in VB please

Thank you
Post #964674
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse