OPENDATASOURCE instead of Linked Server

2019-05-26 04:21发布

问题:

I have a situation where a linked server to an access DB is crashing my SQL server.

Crashed here means adding the linked server causes all other linked servers using that provider to stop working. Any queries to those linked servers hang and don't complete. This situation persists until the server is restarted.

However, when I use OPENDATASOURCE to connect to the same data source I don't have this problem.

Why would one work and the other crash?

The provider I'm using is Microsoft.ACE.OLEDB.12.0. I have Dynamic parameter and Allow inprocess enabled. Example query below

select 
*
from OPENDATASOURCE('Microsoft.ACE.OLEDB.12.0', 
    'Data Source=\\networkPath\Reporting.accdb')...MyAccessTable

回答1:

SQL Server is crashing probably because the SQLSERV.EXE Call stack got filled by OLEDB object or because the data access library configuration is not correct.

Try this :

  1. Make sure Allow inprocess option is activated on your provider
  2. Start SQLSERV.EXE with a bigger Call Stack using -g 512 startup parameters