In order to read from an Spreadsheet through you need to install the Office 2010 Database Engine. Afterwards, run statements similar to the following:

EXEC sp_configure 'Show Advanced Options', 1
RECONFIGURE with override
GO

EXEC sp_configure 'Ad Hoc Distributed Queries', 1
RECONFIGURE with override
GO

SELECT * 
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;Database=C:ImportFileName.xlsx',
'SELECT * FROM [Sheet1$]')



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here