Export (0) Print
Expand All
ABS
ALL
AND
ANY
AVG
bit
COS
COT
DAY
EXP
GO
IN
LEN
LOG
MAX
MIN
NOT
OR
PI
SET
SIN
STR
SUM
TAN
USE
VAR
Expand Minimize
1 out of 1 rated this helpful - Rate this topic

TYPEPROPERTY

SQL Server 2000

Returns information about a data type.

Syntax

TYPEPROPERTY ( type , property )

Arguments

type

Is the name of the data type.

property

Is the type of information to be returned for the data type. property can be one of these values.

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 not found.

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.

Return Types

int

Examples

This example returns the precision or number of digits for the integer data type.

SELECT TYPEPROPERTY( 'tinyint', 'PRECISION')

See Also

COLUMNPROPERTY

Metadata Functions

OBJECTPROPERTY

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.