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

Problem:: SSIS: Excel Destination. Mapping columns dynamically Expand / Collapse
Author
Message
Posted Monday, November 8, 2010 2:49 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, November 22, 2012 1:18 PM
Points: 3, Visits: 36
Hi

My requirement is as follows:

I have multiple Excel sheets in a folder which are in same format.

I need only one Column(for Example Column D) in all excel sheets and need move the data into an Excel Sheet(Data from all the excel sheets should move into one excel sheet but into different columns).

Example:
We have three excel sheets in a folder(which are in same format).
Need to capture data in Column D of all these three excels.
Output should go into three different columns(Column A consists of first excel sheet data,Column B consists of second excel data..and so on..) of excel sheet.


I have used Foreach Loop Container to read the data from all the excel sheets in the folder.
But the data moves into only one column of the output excel sheet.

How can we move the data multiple columns of the output excel?


Do any one know about this? If i am missing any other details which are required let me know.
Thanks in Advance.

Post #1017042
Posted Monday, November 8, 2010 8:39 AM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Tuesday, November 18, 2014 8:08 AM
Points: 125, Visits: 493
I'm editing my post. I just tried to do what you are doing in SSIS and I can't figure out a way to merge data without a common key of some sort.

So, the only way I can really think of to get it to work the way you want it to would be to stage the data in separate tables first and then extract the data from your staging tables and use the row number function to create a surrogate key so that you can join both data sets together and insert those columns one next to the other in your destination file.

Another option might be to extract the data from your excel files and use a script task to create a row number column on the fly and then merge join them together based on that row number column which is acting as your common key between the two sources.

You might have to adjust your join to a left outer or right outer if one of your sources has more or less rows than the other.

Kind of a goofy way to get the result you want, but there isn't much use in the data integration world for joining non-related data together.

Maybe someone else has a better option.
Post #1017235
Posted Thursday, October 3, 2013 5:31 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: 2 days ago @ 4:25 AM
Points: 25, Visits: 65
Hi,

can u explain me how to export the data with dynamic column into some flat file..
Please

Thanks.
Deepika
Post #1501123
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse