Penguen
Penguen

Reputation: 17268

how can i get data from excel via "select statement" in sql 2005?

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?

Upvotes: 0

Views: 7606

Answers (3)

tooba
tooba

Reputation: 569

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.

Upvotes: 0

shahkalpesh
shahkalpesh

Reputation: 33476

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.

Upvotes: 3

UltraCommit
UltraCommit

Reputation: 2276

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.

Upvotes: 1

Related Questions