question

MSSQLEMAILS avatar image
MSSQLEMAILS asked

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

sql-server-2005data-import
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mrdenny avatar image
mrdenny answered

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

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Madhivanan avatar image
Madhivanan answered

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

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Benjamin avatar image
Benjamin answered

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.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.