Suhul
asked on
Importing Excel to SQL
How can I import an Excel work book(more than one worksheet at a time) to SQL serverusing T-sql?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
that was very helpful....thank you
if you are going to use different excel files all the time, it is good to go with OPENROWSET rather than LinkedServer
Use this:
BULK INSERT AdventureWorks.Sales.Sales OrderDetai l
FROM 'f:\orders\lineitem.xls'
WITH
(
FIELDTERMINATOR =' |',
ROWTERMINATOR =' |\n'
)
BULK INSERT AdventureWorks.Sales.Sales
FROM 'f:\orders\lineitem.xls'
WITH
(
FIELDTERMINATOR =' |',
ROWTERMINATOR =' |\n'
)
Ritesh,
I don't know how to import all sheets without knowing their names using OPENROWSET. Do you?
I don't know how to import all sheets without knowing their names using OPENROWSET. Do you?
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
1.) Linked Server: http://www.sqlhub.com/2009/04/create-linked-server-with-excel-2007.html
2.) OpenRowSet: http://www.sql-server-helper.com/tips/read-import-excel-file-p01.aspx
3.) Import/Export wizard or SSIS: