sp_datatype_info returns a list of datatypes with information about each column.
The lengths for varchar columns shown in the result set tables are maximums; the actual lengths depend on the target database.
Column |
Datatype |
Description |
---|---|---|
TYPE_NAME |
varchar(128) NOT NULL |
Name of the Transact-SQL datatype or the target database datatype that corresponds to the ODBC datatype in the DATA_TYPE column. |
DATA_TYPE |
smallint NOT NULL |
ODBC datatype to which all columns of this type are mapped. |
PRECISION |
int |
Maximum precision allowed for this datatype; NULL is returned for datatypes where precision is not applicable. |
LITERAL_PREFIX |
varchar(128) |
Characters used to prefix a literal; NULL is returned for datatypes where a literal prefix is not applicable. |
LITERAL_SUFFIX |
varchar(128) |
Characters used to mark the end of a literal; NULL is returned for datatypes where a literal suffix is not applicable. |
CREATE_PARAMS |
varchar(128) |
Description of the creation parameters required for this datatype (for example: precision and scale); NULL is returned if the datatype does not have creation parameters. |
NULLABLE |
smallint NOT NULL |
|
CASE_SENSITIVE |
smallint NOT NULL |
|
SEARCHABLE |
smallint NOT NULL |
|
UNSIGNED_ATTRIBUTE |
smallint |
|
MONEY |
smallint NOT NULL |
|
AUTO_INCREMENT |
smallint |
|
LOCAL_TYPE_NAME |
varchar(128) |
The database name or the Transact-SQL name for the datatype. |
MINIMUM_SCALE |
smallint |
Minimum scale for the datatype; NULL if scale is not applicable. |
MAXIMUM_SCALE |
smallint |
Maximum scale for the datatype; NULL if scale is not applicable. |