SQL flat file import of selected columns

Is it possible to import a flat file, and only get selected columns? I am using the SQL Management Studio import wizard, and when I tell it to skip the column, it simply deletes the headers, and shifts everything down, making a total mess of everything.

If I have four columns, and only want to import columns 2 and 3. How do I go about doing that.

I am sure I can do it by editing the flat file, but this is something I am trying to automate that will be delivered nightly.

Any help would be greatly appreciated.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Hi Phil -

  When walking through the wizard try not to delete any columns.  Walk through the wizard until you get to the screen that asks which destination table to import into.

  Click on the "Edit Mappings" button.

  Within the "Destination" column of the Column Mappings dialogue you can select "<ignore>" for each column you do not want imported / created in your final destination table.

Hope that helps.

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
If you will use SSIS you will probably solve this very quickly.
Are you familiar with SSIS (SQL Server Integration Services) ?

If not it is very simple and friendly tool to use once you know it:


SSIS Tutorial: Creating a Simple ETL Package
Talking about importing frmo flat file:


SSIS Tutorial: Working with Connection Managers
Finally and most important for you is this link:


SSIS: Importing data from a text file using a package
Good luck and have fun with it :)
phil301Author Commented:
Thanks guys, I am not familiar with working with SSIS directly, I was saving the IMPORT as an SSIS package to execute.
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

Next step for you "to automate that will be delivered nightly" as you said.
Once your Package will be ready (.dtsx file),
you would like to Schedule and Run a SSIS package ( DTS ) Job:

How to Schedule and Run a SSIS package ( DTS ) Job

Try this link from Microsoft Technet:

Managing SSIS Packages with SQL Server Management Studio
phil301Author Commented:
Great guys, thanks for the quick answers. This will help tremendously.
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 2008

From novice to tech pro — start learning today.