Estou com dificuldades para carregar uma planilha feita no Excel 2010 com o OPENROWSET.
Ao executar a query:
EXEC sp_configure 'show advanced options', 1
GO
Reconfigure
GO
EXEC sp_configure 'Ad Hoc Distributed Queries', '1';
GO
Reconfigure
GO
SELECT * FROM OPENROWSET (
'Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;Database=D:\ListaMedicamentos.xlsx;HDR=YES;IMEX=1',
'SELECT * FROM [Sheet1$]'
);
Tenho o seguinte erro:
Cannot process the object "SELECT * FROM [Sheet1$]". The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)" indicates that either the object has no columns or the current user does not have permissions
on that object.