SSIS: loading flat file data into the table, output column names.

Hi, I am loading pipe-delimited file into the database table.
The file contains only data, first row doesn't have column names. Database table columns match the datafile columns.
I'd like to match SSIS package 'Flat File Source - Output Columns' names to the db table columns. Now flat file source columns names are 'Column 0', 'Column 1', ...
I want to replace those values with real names (table column names).
Thank you for your help.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
In your destination task double-click to open, then go to Mappings.
To delate a column mapping, click-and-delete on the arrows to remove a mapping.
To add a column mapping, click-and-hold on a column in the 'Available Input Columns' list, drag to the 'Available Destination Columns' list, then let go of the mouse button.
quasar_eeAuthor Commented:
Yes, that's what I do now, drag and drop every column one by one from source to destination because source column names don't match destination column names.
I'd like to name flat file source columns (Column 0, Column 1, ...) the same as matching destination database table columns. I can rename source columns manually one by one, however, I am wondering if there is better way.
ValentinoVBI ConsultantCommented:
To get source and destination columns to match automatically, what I usually do is ensure the columns down the pipe have got the right (destination) name as soon as possible.  In this case that means renaming the columns through the Advanced properties page of the Flat File source.

I can rename source columns manually one by one, however, I am wondering if there is better way.

No, not that I'm aware of.  You could modify the XML (an SSIS package is XML) manually but in this case I wouldn't really recommend it.  The name is used in more than one place and you'll run into issues if you forget one of them.

In addition, if you need to manipulate the content of a column somehow, you can add a suffix like SomeColumn_SRC to the original column.  Then give the result of the manipulation the actual destination name.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
How's it goin, eh?  I'm here now, so let me know if you need any screen shots to help you out. Flat file destination rename column names
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.