Solved

SSIS Column Header Mapping

Posted on 2010-09-20
4
341 Views
Last Modified: 2013-11-10
Hi!

I am going to see if I can explain my situation without confusion. :o)

I set up a package to import flat files into an OLE db destination (SS table). These flat files that will be imported will have various column headers (and in any order) and I want to select ONLY those columns in the file that match the column header names in the table and then map them to the appropriate table column.

I tried a simple mapping directly from the flat file connection manager to the table and the data is not being imported into the proper columns, because the columns in the flat file are arranged in a different order.

Is there a component to search specific column header names and map only the data from those columns? Any ideas?

Thank you!
0
Comment
Question by:DixieDev
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
vdr1620 earned 125 total points
ID: 33719366
NO... There is no such component..you will need to write a script task..

If the file is not big enough.. i would suggest you to load all the data into staging table irrespective of the order and Probably then you can use SQL to insert the data into table from selected columns


Ref:
http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/0503cd40-d28d-49a3-af1c-e19b03033ffe
0
 
LVL 30

Expert Comment

by:Reza Rad
ID: 33722205
as vdr1620 said, there is not dynamic meta data task or transformation in SSIS.
SSIS data flow tasks only will do transfer when data structure is same ( by data structure I mean name of columns, data type of columns and number and order of columns)

if your data structure is not same at all, suggestion of vdr1620 is good work around ( load whole in a table and then select data in unique structure in data flow)


0
 

Author Comment

by:DixieDev
ID: 33724358
OK, thank you for the suggestions!
0
 

Author Closing Comment

by:DixieDev
ID: 33724394
Thank you
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question