fr--Enable the SQL Server Advance Options
sp_configure 'show advanced options', 1
RECONFIGURE;
GO
--Enable the Ad Hoc Queries
sp_configure 'Ad Hoc Distributed Queries', 1;
RECONFIGURE;
GO
--------------------------------------------
-- The Database driver is Microsoft.ACE.OLEDB.12.0 , Excel version 12.0
-- SELECT *
-- FROM OPENROWSET
-- ('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;Database=<<filename>>;HDR=YES',
-- 'SELECT * FROM <<sheetname>>')
-- Example
SELECT *
FROM OPENROWSET
('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;Database=C:\Employee.xlsx;HDR=YES',
'SELECT * FROM [Sheet1$]')This code snippet demonstrates inserting Bulk data from an XLSX File.
