Import excel data in sql server 2005

Wednesday, 30 May 2012

Import excel data in sql server 2005


Run the below Query in Sql Server query window


Select * FROM
OPENROWSET
('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\test.xls;HDR=YES', 'SELECT  * FROM [SheetName$]')

SheetName: Sheet which data will be read.
C:\test.xls: Location with name of excel file.

No comments:

Post a comment