x

Auto Import Excel File Into SQL 2005

Hi All,

I am new to SQL.

I have an excel file that is saved in a location C:\F2008\daily.xls.

How can I automate a process to upload this into a table in SQL.

The SQL database is on a server named SBS2K3, the SQL instance is named HOME database name is DailyReports table name is DATA.

I am new to SQL so if somebody could help with step by step instructions would be great.

Thanks again

Regards

Gerard

more ▼

asked Oct 10, 2009 at 04:03 AM in Default

MSSQLEMAILS gravatar image

MSSQLEMAILS
11 1 1 1

(comments are locked)
10|1200 characters needed characters left

3 answers: sort voted first

You'll want to setup an SSIS package to handle the import from the Excel sheet into the database.

more ▼

answered Oct 11, 2009 at 05:36 PM

mrdenny gravatar image

mrdenny
928 3

(comments are locked)
10|1200 characters needed characters left

or use this script and schedule it run regularly
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926

more ▼

answered Oct 12, 2009 at 03:14 AM

Madhivanan gravatar image

Madhivanan
1.1k 1 3 6

(comments are locked)
10|1200 characters needed characters left

Try creating a scheduled SSIS package through the wizard. There are some difficulties with the wizard but if you data is pretty straightforward it should get you started.

  1. Right-click on your target database
  2. Under the Tasks menu click Import Data...
  3. On the Choose a Data Source screen select Microsoft Excel from the dropdown list and then Browse to or type the path of the file.

Continue through the wizard picking the appropriate options. If you run it and get a truncation error, you'll need to go back a few steps in the wizard and click on Advanced to define the length of the destination column. Typically this happens if you have a description field or the like. Let me know if you need additional instructions for creating or scheduling the import package.

more ▼

answered Oct 12, 2009 at 07:56 PM

Benjamin gravatar image

Benjamin
320 2 3 4

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x1950
x15

asked: Oct 10, 2009 at 04:03 AM

Seen: 5393 times

Last Updated: Oct 10, 2009 at 05:41 PM