Returns information about the datatypes supported by the current environment.
For additional syntax information for sp_datatype_info, see the Microsoft SQL Server Transact-SQL Reference.
The following columns have been inserted after the MAXIMUM_SCALE column and before the USERTYPE column.
Column | Datatype | Description |
---|---|---|
SQL_DATA_TYPE | smallint | The value of the SQL datatype as it appears in the TYPE field of the descriptor. This column is the same as the DATA_TYPE column, except for the datetime and ANSI interval datatypes. NOT NULL. |
SQL_DATETIME_SUB | smallint | The datetime or ANSI interval subcode if the value of SQL_DATA_TYPE is SQL_DATETIME or SQL_INTERVAL. For datatypes other than datetime and ANSI interval, this field is NULL. |
NUM_PREC_RADIX | int | The number of bits or digits for calculating the maximum number that the column can hold. If the datatype is an approximate numeric type, then this column contains the value 2 to indicate that COLUMN_SIZE specifies a number of bits. For exact numeric types, this column contains the value 10 to indicate that the COLUMN_SIZE specifies a number of decimal digits. Otherwise, this column is NULL. By combining the precision with radix, the application can calculate the maximum number that the column can hold. |
INTERVAL_PRECISION | smallint | The value of interval leading precision if interval datatype; otherwise NULL. |
In addition, the return value for the PRECISION column is in base 10.