SQLGetData behavior since KB5019959

Truc, Christophe 21 Reputation points


I have noticed a different behavior since KB5019959, and more precisely concerning the fetch of doubles. We used to call SQLGetData with a zero BufferLength. As per the documentation, this buffer size should give the buffer size when managing variable length data types such as characters or binary data. This was ok but now fails since the new KB was installed. Currently, it is necessary to define BufferLength, for example using sizeof (SQLDOUBLE).

I am wondering if this is a desired change since the documentation indicates that SQLGetData ignores the buffer size for fixed size variables.


SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,268 questions
{count} votes

Accepted answer
  1. Erland Sommarskog 106K Reputation points MVP

    That is indeed the ODBC driver that comes with the OS. That ODBC driver is twenty years old and you should not use it. You should use the ODBC 18 Driver for SQL Server.

    It is certainly not unlikely that you will face similar issues when you move to a new driver. (I guess that this is a security fix that has been backported to this arcane version). You need the new driver to have full support for features added to SQL Server since SQL 2005.

    0 comments No comments

0 additional answers

Sort by: Most helpful