views:

46

answers:

5

is there any method to get data from excel to sql ? i think that we can do without any writing C#codes. For example : select * from MyExcellFile.xls.Sheet1. Or may be any wizard in sql?

+1  A: 

You can save your EXCEL file as CSV file, and then you can use the following site in order to TRANSFORM the CSV file into a succession of INSERT statements:

http://csv2sql.evandavey.com/

(FREE Online CSV to SQL Converter)

Please be careful to avoid submitting sensitive data to the site, for obvious privacy reasons.

The chicken in the kitchen
+3  A: 

See if this page with example of using OPENDATASOURCE helps.

EDIT: Towards the bottom of the page, you will see an example of a query that uses excel as its source.

shahkalpesh
A: 

Refer this post to know more informations on how to interact with EXCEL from SQL Server http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926

Madhivanan
+2  A: 

There are many methods to do the same. That again depends on your requirement and how often you want to import excel file and the format of excel. Refer to this link http://support.microsoft.com/kb/321686

lucky
A: 

Easiest way is via the SSIS/DTS wizard. Right click on the database in SQL Server, choose Tasks then Import Data. One of the source data options is an Excel spreadsheet. You can them import it into it's own table in SQL Server or map the columns into existing tables. This is the easiest way for a one time upload.

tooba