Retrieving Column comments using MS SQL Server ODBC driver


  • I am using the following function call to retrieve the REMARKS of a column of my MS SQL server table.

    SQLBindCol(st_handle,12, SQL_C_WCHAR,comment,512-1, &l);

    But comment is always an empty string.All other columns are retrieved successfully.

    Is there any setting that needs to be set in ODBC configuration?

    Wednesday, September 11, 2013 1:10 PM

All replies

  • Hi Sudhindra123,

    From the codes syntax, there is no error. An ODBC 3.0 or 2.x application will always bind to the ANSI data types. For optimum performance, an ODBC 3.5 (or higher) application should bind to the ANSI data C type if the SQL column type is ANSI, and should bind to the Unicode C data type if the SQL column type is Unicode. Please check the data type of column 12 and ODBC version.

    Unicode Data

    BUG: SQL Server ODBC Driver Incorrectly Maps Unicode Datatypes with SQL_C_DEFAULT

    Allen Li
    TechNet Community Support

    Friday, September 13, 2013 2:41 AM
  • We use the following function call the ODBC behaviour.


    I have even tried setting it to 3.8 using the following function call. 


    But the problem still persists.

    Wednesday, September 18, 2013 12:01 PM