Share via


SQLGetTypeInfo

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: int identity, smallint identity, tinyint identity, decimal identity, and numeric identity. 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.

SQLGetTypeInfo and Table-Valued Parameters

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).

SQLGetTypeInfo Support for Enhanced Date and Time Features

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

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

SQLGetTypeInfo Support for Large CLR UDTs

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

See Also

Concepts

Other Resources