took me some time to search for it eventhough i already found a few months ago ;(
PS: when try this query, make sure no application open the excel file otherwise u'll get an error
u need to enable Ad Hoc Distributed Queries configuration
see this link
see u
-- Read from Excel file
SELECT *
FROM OPENROWSET(
'Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=PATH_TO_EXCEL_FILE_HERE;IMEX=1;HDR=Yes;',
'SELECT * FROM [SHEET_NAME_HERE$]')
Or
SELECT *
FROM OpenDataSource(
'Microsoft.Jet.OLEDB.4.0',
'Data Source="C:\TemplateImportBudget.xls";Extended properties=Excel 8.0;')...Expenses$
PS: when try this query, make sure no application open the excel file otherwise u'll get an error
u need to enable Ad Hoc Distributed Queries configuration
see this link
see u
Comments