Returns information about a data type.
TYPEPROPERTY( type, property )
Property | Description | Value returned |
---|---|---|
Precision | Precision for the data type. | The number of digits or characters.
NULL = Data type not found. |
Scale | Scale for the data type. | The number of decimal places for the data type. NULL = Data type is not numeric or |
AllowsNull | Data type allows null values. | 1 = True 0 = False NULL = Data type not found. |
UsesAnsiTrim | ANSI padding setting was ON when the data type was created. | 1 = True 0 = False NULL = Data type not found, or it is not a binary or string data type. |
int
This example returns the precision or number of digits for the integer data type.
SELECT TYPEPROPERTY( 'tinyint', 'PRECISION')
COLUMNPROPERTY | Metadata Functions |
OBJECTPROPERTY |