Import Excel Spreadsheet Data into SQL Server Database Table Using SqlBulkCopy
- 5
- Add a Comment
- No Related Post
OK, so the need to export Excel Spreadsheet data over to a SQL Server Database Table does not present itself to me everyday. No matter, this is just one more talent that I can not put under my belt thanks to the article below.
Per another question I received, the last thing I wanted to mention on the subject of Excel is that you can use SqlBulkCopy to transfer Excel Spreadsheet data at high speeds to a SQL Server Database Table. I talked about SqlBulkCopy in a previous ADO.NET Tutorial:
* SqlBulkCopy - Copy Table Data Between SQL Servers at High Speeds - ADO.NET 2.0 New Feature
You can view my other posts on Excel for more information about using ADO.NET to read and write to Excel Workbooks and Worksheets:
* Reading Excel Worksheet and Column Schema Information Using ADO.NET 2.0 and GetSchema
* Reading and Writing Excel Spreadsheets / Worksheets Using ADO.NET C# DbProviderFactory….. Source: davidhayden.com
[tags]database,data,excel,sql server,spreadsheet[/tags]

5 Comments
London
October 23rd, 2006
at 10:00am
hi im wondering if anyone knows for real how to import data from excel into an sql database…i have to update my maid service clients in mississauga and am having the hardest time…thanks.
Long Island
October 27th, 2006
at 9:04am
contact me for working code - solved csv import today
Ian
January 9th, 2007
at 5:32pm
Do you have a tutorial on how to get data from a spread sheet into a sql database on an linux webserver, my knowledge of php and sql is at a real beginner stage, I can create a table via cpanel on the server but then have no idea how to get the data across after this, I just built a form and script and submitted over 200 names this way to get the data inserted.The thought of doing such a mind numbing task again is not a good one.
Cheers
Ian
Rahul
February 8th, 2007
at 1:17am
how to import ms access database to sql server with different structure in C #. plz send me code
ed bemiss
June 13th, 2007
at 3:59pm
I have a small sports website. I have made a simulation model for 2 teams that generates a final score, box score , and player statistics on an excel spread sheet. I need to get this into another code to upload it to the website. I have some that is helping me, but I have to believe there is an easier way for me to make this project come to life. thanks in advance.
Ed