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

Merge records in a sorted order in SSIS. Expand / Collapse
Author
Message
Posted Friday, May 3, 2013 9:37 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, June 5, 2014 1:27 PM
Points: 9, 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!


  Post Attachments 
screnshot.JPG (3 views, 265.33 KB)
Post #1449268
Posted Monday, May 6, 2013 7:29 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:39 AM
Points: 5,100, Visits: 11,900
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.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #1449713
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse