Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Importing data to empty table

Author  Topic 

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2012-03-29 : 17:38:40
Is it possible to import from an excel file into a SQL Server database table? How?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-03-29 : 17:40:01
Yes. You can use bcp, DTS/SSIS, import/export wizard, OPENQUERY. Lots of options here. I prefer bcp.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-29 : 19:03:37
And I prefer to give a requirement that I ONLY Accept a delimited or fixed width raw data file..no excel, no access, no word, no 1-2-3, no abacus, no dbaseIII, no anything that is in a proprietary format

Dig?

The bcp that data to an emptu staging table where all the columns are varchar(max)

The perform audits, integrity and whatever other checks you want

If it fails, tell the sending bonehead to fix the file

If not, populate your relational table

It is WAY past 5:00



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

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

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -