SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Merge records in a sorted order in SSIS.


Merge records in a sorted order in SSIS.

Author
Message
Learner093
Learner093
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 49
I have a set of record types saying TH as Header and T1a, T1b, T1c, T1d, T1e, T2a, T2b, T2c, T2d, T2e as other type of records. TH table has a SortKey column with values 1, 2, 3, 4, 5.
All these record types are tied by a column called RecordID. The output fashion I desire is below having corresponding number of records listed under associated TH record:

RecordType RecordID SortKey

TH 3678 1
T1a 3678
T1b 3678
T1e 3678

TH 2455 2
T1c 2445
T2d 2445

TH 4522 3
T2d 4522

The SortKey order has to be maintained in 1, 2, 3 fashion in output file, and keeping all the record types tied by RecordID because the output file has to be read in the order of SortKey.
I am doing this all in SSIS using Merge task to have the records merged as TH ->T1a ->T1b....

Thank you for you help!
Attachments
screnshot.JPG (6 views, 265.00 KB)
Phil Parkin
Phil Parkin
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18213 Visits: 20392
Learner093 (5/3/2013)
I have a set of record types saying TH as Header and T1a, T1b, T1c, T1d, T1e, T2a, T2b, T2c, T2d, T2e as other type of records. TH table has a SortKey column with values 1, 2, 3, 4, 5.
All these record types are tied by a column called RecordID. The output fashion I desire is below having corresponding number of records listed under associated TH record:

RecordType RecordID SortKey

TH 3678 1
T1a 3678
T1b 3678
T1e 3678

TH 2455 2
T1c 2445
T2d 2445

TH 4522 3
T2d 4522

The SortKey order has to be maintained in 1, 2, 3 fashion in output file, and keeping all the record types tied by RecordID because the output file has to be read in the order of SortKey.
I am doing this all in SSIS using Merge task to have the records merged as TH ->T1a ->T1b....

Thank you for you help!


You haven't asked a question, so how can we help?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search