Merge 3 text files

Who is online?  0 guests and 1 members
Home  »  Forums   »  microsoft business intelligence   »  integration services   » Merge 3 text files

Merge 3 text files

Topic RSS Feed

Posts under the topic: Merge 3 text files

Posted: 4/25/2012

Padawan 172  points  Padawan
  • Joined on: 2/16/2010
  • Posts: 51

Hi I tried to merge 3 text files using UNION ALL TASK(all 3 are different headers).

ex: Text1: abc 123

Text 2: def 456 hello hi

Text3: xyz hi hi hi hi hi hi dsfdsfsdfs

I want output like this:

abc 123

def 456 hello hi

xyz hi hi hi hi hi hi dsfdsfsdfs

UNION ALL is giving me different order like this.....

def 456 hello hi

abc 123

xyz hi hi hi hi hi hi dsfdsfsdfs

Can any one suggest me what other options I can use (maybe script task?)

Thank you

 

 

 

 


Posted: 4/25/2012

Jedi Knight 2272  points  Jedi Knight
  • Joined on: 2/22/2010
  • Posts: 201
Answered  Answered

Read this post by Alberto Ferrari, might help you figure out your issue: http://sqlblog.com/blogs/alberto_ferrari/archive/2007/04/10/mantaining-order-in-ssis-flow-problems-with-merge.aspx

UNION ALL doesn't maintain order


Posted: 4/25/2012

Padawan 172  points  Padawan
  • Joined on: 2/16/2010
  • Posts: 51

Thank you, I did used merge and sort, it worked out perfectly, but I had to do 2 dataflows instead of one.

dataflow1: text1+text2 (output1)

dataflow2: output1+text3


Page 1 of 1 (3 items)