Importing Excel file into SQL Server 2008 (by BCP)

Is it possible to use BCP command to import XLS file into SQL server?
I mean not a CSV file but a regular spreadsheet?
Thank you!
larisa1970Asked:
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.

Brad HoweDevOps ManagerCommented:
Hi,

You can create a dataflow task in an SSIS package with an Excel file source to complete the import.

Cheers,
Hades666
0
larisa1970Author Commented:
But can  it be done using BCP command?
0
Brad HoweDevOps ManagerCommented:
You could also just use the SQL Import and Export wizard.

1. Right-click on the database name, choose Tasks, and then Import Data

This will also create the SSIS package for you.

Cheers,
Hades666
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Brad HoweDevOps ManagerCommented:
Not that i know of.

Hades666
0
Brad HoweDevOps ManagerCommented:
Here is the guidlines for BCP.

http://msdn.microsoft.com/en-us/library/ms188609.aspx

"To bulk import data from a Microsoft FoxPro or Visual FoxPro table (.dbf) file or a Microsoft Excel worksheet (.xls) file, you would need to convert the data into a CSV file that complies to the preceding restrictions"

Sorry,
Hades666
0
larisa1970Author Commented:
There is an existing process that dynamically loads and parses the file (using BCP). It used to be a csv file and there is a bunch of procedures written around it. Today the data provider changed it to excel file.
If I there's a way to bcp in an excel file - then I have to change only 1 line of code.
Otherwise I have to re-write the whole process
0
Brad HoweDevOps ManagerCommented:
I hear you, I wish I could help.

You could use tools like convertxls from commandline and then bcp the cvs.

Hades666
0

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
larisa1970Author Commented:
I'll probably have to go with convertxls.
Thank you for your help
0
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.