0

I am getting the following error when I execute a simple linked server query.

OLE DB provider "MSDASQL" for linked server "name" returned message "HTTP request returned status code 400 (Bad Request)".
Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query "SELECT 1" for execution against OLE DB provider "MSDASQL" for linked server "name". 

Also, when I try to expand the tables under Catalogs, I get the following error:

Cannot obtain the schema rowset "DBSCHEMA_TABLES" for OLE DB provider "MSDASQL" for linked server "name". The provider supports the interface, but returns a failure code when it is used.

I am running this query and have sysadmin privilege's.: select * from openquery(name, 'SELECT 1')

Below are the settings for Linked Server properties:

  1. Allow in-proc is unchecked.

  2. MSDAINITIALIZE has the necessary permissions.

  3. Security settings > Be made with the current security context.

The test connection succeeds on the ODBC side as well as SQL server side, but when anyone tries to query we get that error above. I have not found any helpful articles while doing research. Any ideas on how I may be able to solve this?

3
  • Add the ODBC driver you are using along with configuration values. MSDASQL is just the generic OLE DB provider for ODBC.
    – Dan Guzman
    Feb 7, 2022 at 21:49
  • @DanGuzman it is third party ODBC driver that my company built. What specific configuration values should I provide? Feb 7, 2022 at 22:07
  • The "HTTP request returned status code 400 (Bad Request)" error is returned by your custom ODBC driver, not SQL Server, so it's unlikely you will get help here. I suggested including config values (e.g. connection string parameters) in case someone here had experience with the driver.
    – Dan Guzman
    Feb 7, 2022 at 22:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.