I am trying to take data from an Excel sheet and store it into SQL Server 2019 through the Openrowset statement. First I asked to enable 'ad hoc distributed queries' and 'show Advanced Options', which I did, but still alleged to execute it gets stuck and not is not providing the desired result. I'm doing this on my local computer.
Example query:
SELECT *
FROM OPENROWSET ('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;Database=C:\Users\Public\Documents\Prueba.xlsx',
'Select * from [Hoja1$]')
AND it is a small Excel file, just a test, 10 rows, no more, I'm doing this on my local computer, I've done it before in my job computer and it works, but not here.
C:\Users\Public\Documentsfolder? Is the Excel file closed? (Office applications hold non-shareable locks on files they have open.)Microsoft.ACE.OLEDB.12.0(Microsoft Access Database Engine 2010) is quite old, do you have it installed? Are you not using a more current version, likeMicrosoft.ACE.OLEDB.16.0(Microsoft Access Database Engine 2016)?