Blog Post

SQL Server Support Blog
2 MIN READ

PolyBase Generic ODBC - Error calling: SQLSetDescRec - The driver does not support this function.

NathanMSFT's avatar
NathanMSFT
Icon for Microsoft rankMicrosoft
Mar 30, 2022

Problem

When trying to query an external table created for a generic ODBC external data source, the following error can be observed:

 

Message 7320, level 16, state 110, line 87

Unable to execute query "Remote Query" against OLE DB provider "MSOLEDBSQL" on link server "(null)". 105082; Generic ODBC error: OdbcBufferReader.ReadBuffer, error in OdbcReadBuffer: SqlState: IM001, NativeError: 0, 'Error calling: SQLSetDescRec(this->GetHdesc(), (SQLSMALLINT)column->idxServerCol, (SQLSMALLINT)column->odbcReadType, 0, column->valueLength, (SQLSMALLINT)column->precision, (SQLSMALLINT)column->scale, (SQLPOINTER)(pBuffer + column->valueOffset), (SQLLEN *)indPtr, (SQLLEN *)indPtr), SQL return code: -1 | SQL Error Info: Error <1>: ErrorMsg: [Microsoft][ODBC Driver Manager] The driver does not support this function. | Error calling: pReadConn->ReadBuffer(pBuffer, bufferOffset, bufferLength, pBytesRead, pRowsRead) | state: FFFF, number: 239, active connections: 9', Connection String: Dsn={DSN Name};Driver={Driver Name};uid=root;server=xxxxx;port=xxxx;database=xxxx.

 

Cause

PolyBase Data Movement Service is instructing the driver to call SQLSetDescRec Function - ODBC API Reference | Microsoft Docs. Just as the error indicates the driver does not support this function and returns this error as a result. This is a driver-dependent behavior and could, in principal, occur for any generic ODBC driver used for PolyBase external data source.

 

Resolution

SQL Server 2019 Cumulative Update 11 included a new CONNECTION_OPTION to prevent this error from occurring. To apply this workaround you need to have applied Cumulative Update 11 or later.

 

To resolve this issue you can add the following key-value pair to the CONNECTION_OPTIONS of the external data source used by the external table:

 

PolyBaseOdbcSupportsSetDescRec=false

 

This should force the PolyBase Data Movement to not call that SQLSetDescRec function and avoid the error.

Published Mar 30, 2022
Version 1.0
  • fmantovani's avatar
    fmantovani
    Copper Contributor

    Hello, trying to connect PolyBase to DB2 here and receiving the notorious error: 

     

    OLE DB provider "MSOLEDBSQL" for linked server "(null)" returned message "Cannot generate SSPI context".
    Msg -2146893042, Level 16, State 1, Line 20
    SQL Server Network Interfaces: No credentials are available in the security package

     

    The connection I'm creating looks like this: 

     

    CREATE EXTERNAL DATA SOURCE Test_PolyBase
    WITH (
    LOCATION = 'odbc://192.168.1.44:50000'
    ,CONNECTION_OPTIONS = 'Dsn={testdb};
    Driver={IBM DB2 ODBC DRIVER - DB2COPY1};
    uid=root;
    server=192.168.1.44;
    port=50000;
    database=testdb;
    PolyBaseOdbcSupportsSetDescRec=false'
    --,PUSHDOWN = ON
    ,CREDENTIAL = Test_PolyBase
    )

     

    What am I doing wrong?