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

two source columns to single destination Expand / Collapse
Author
Message
Posted Friday, December 3, 2010 2:58 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, April 25, 2012 5:55 AM
Points: 19, Visits: 69
Hi

i have table tab1 with columns a,b,c and table tab2 with columns x,y,z now i have to load the data into tab3 with columns a,b,x,y

so i have created two oledb sources (tab1 & tab2) and a oledb desitination(tab3) now which transformation should i use to get two columns(a,b) form tab1 and two columns(x,y) from tab2 and load into destination table tab3(a,b,x,y)


please let me know how to achieve this

Post #1029719
Posted Friday, December 3, 2010 5:40 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 8:03 AM
Points: 3,928, Visits: 5,116
ahmed7.bi (12/3/2010)
Hi

i have table tab1 with columns a,b,c and table tab2 with columns x,y,z now i have to load the data into tab3 with columns a,b,x,y

so i have created two oledb sources (tab1 & tab2) and a oledb desitination(tab3) now which transformation should i use to get two columns(a,b) form tab1 and two columns(x,y) from tab2 and load into destination table tab3(a,b,x,y)


please let me know how to achieve this



There must be a column in common (i.e. one that can be used in a join operation. This column must be of the same data type and size on both tables.
> the two data sources (select commands) must be ordered by this common column (this will require the use of setting "SQL command").
> In the data sources, advanced edit, input and output tab (last tab), set the output IsSorted = True; and the sorted column set Sort Position = 1
> use a Merge Join component in the data flow, joining the left and right data flows to it - if the above sorting was done correctly, the data sets will automatically be joined.
> select the output you require from the merge join by ticking the required boxes
> from the merge join, connect to the destination table.
> in the destination, map the columns to the destination table columns



____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1029793
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse