Use the OPENROWSET feature to JOIN data in a query against a text file.
Leveraging the answer from @gbn on this question I am trying to
These steps are required on SQL Server 2017 to make OPENROWSET ('Microsoft.ACE.OLEDB.16.0','Excel 12.0;..)
working with a Shared Folder (UNC file-share):
Computer object
Security rights (of the Database Server)Service account
Security rights (the user running the SQL-server process)
EXEC sp_configure 'show advanced options', 1 RECONFIGURE GO EXEC sp_configure 'ad hoc distributed queries', 1 RECONFIGURE GO
DynamicParameters
USE [master] 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
AllowInProcess
, the service-account and the actual user must have modify-permission to the Temp-Folder on C:\Users\service-account\AppData\Local\Temp
. Otherwise you may recieve The provider reported an unexpected catastrophic failure.