SQLGetTypeInfo

 

System_CAPS_ICON_warning.jpg Warning

SQL Server Native Client (SNAC) is not supported beyond SQL Server 2012. Avoid using SNAC in new development work, and plan to modify applications that currently use it. The Microsoft ODBC Driver for SQL Server provides native connectivity from Windows to Microsoft SQL Server and Microsoft Azure SQL Database.

The SQL Server Native Client ODBC driver reports the additional column USERTYPE in the result set of SQLGetTypeInfo. USERTYPE reports the DB-Library data type definition and is useful to developers porting existing DB-Library applications to ODBC.

SQL Server treats identity as an attribute, whereas ODBC treats it as a data type. To resolve this mismatch, SQLGetTypeInfo returns the data types: intidentity, smallintidentity, tinyintidentity, decimalidentity, and numericidentity. The SQLGetTypeInfo result set column AUTO_UNIQUE_VALUE reports the value TRUE for these data types.

For varchar, nvarchar and varbinary, the SQL Server Native Client ODBC driver continues to report 8000, 4000 and 8000 respectively for the COLUMN_SIZE value, even though it is actually unlimited. This is to ensure backward compatibility.

For the xml data type, the SQL Server Native Client ODBC driver reports SQL_SS_LENGTH_UNLIMITED for COLUMN_SIZE to denote unlimited size.

The table type for table-valued parameters is effectively a meta-type—that is, a type used to define other types. Therefore, it does not have to be exposed through SQLGetTypeInfo. Applications must use SQLTables, rather than SQLGetTypeInfo, to retrieve metadata for table types used with table-valued parameters.

For more information, about retrieving metdata for table-valued parameters, see Statement Attributes that Affect Table-Valued Parameters.

For more information about table-valued parameters, see Table-Valued Parameters (ODBC).

For the values returned for date/time types, see Catalog Metadata.

For more general information, see Date and Time Improvements (ODBC).

SQLGetTypeInfo supports large CLR user-defined types (UDTs). For more information, see Large CLR User-Defined Types (ODBC).

SQLGetTypeInfo Function
ODBC API Implementation Details

Community Additions

ADD
Show: