sp_configure 'show advanced options',1 reconfigure go sp_configure 'Ad Hoc Distributed Queries',1 reconfigure go sp_configure 'show advanced options',0 reconfigure go EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.16.0', N'AllowInProcess', 1 GO EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.16.0', N'DynamicParameters', 1 GO
select * from openrowset('Microsoft.ACE.OLEDB.16.0', 'Excel 12.0;Database=c:\code\test.xlsx', 'select * from [Sheet1$A2:ZZ]')