Datatype summary

Table 3-3 lists Open Client and Open Server type constants, their corresponding type definitions, and their corresponding Adaptive Server Enterprise datatypes.

Adaptive Server Enterprise datatypes are identified by Transact-SQL keywords. See the Adaptive Server Enterprise documentation for descriptions of the Adaptive Server Enterprise datatypes.

Table 3-3: Datatype summary

Type category

Open Client and Open Server type constant

Description

Corresponding C datatype

Corresponding server datatype

Binary types

CS_BINARY_TYPE

Binary type

CS_BINARY

binary, varbinary

CS_LONGBINARY_TYPE

Long binary type

CS_LONGBINARY

None

CS_VARBINARY_TYPE

Variable-length binary type

CS_VARBINARY

None

Bit types

CS_BIT_TYPE

Bit type

CS_BIT

bit

Character types

CS_CHAR_TYPE

Character type

CS_CHAR

char, varchar

CS_LONGCHAR_TYPE

Long character type

CS_LONGCHAR

None

CS_VARCHAR_TYPE

Variable-length character type

CS_VARCHAR

None

CS_UNICHAR_TYPE

Fixed-length or variable-length character type

CS_UNICHAR

unichar

univarchar

CS_XML_TYPE

Variable-length character type

CS_XML

xml

Datetime type

CS_DATE_TYPE

4-byte date type

CS_DATE

date

CS_TIME_TYPE

4-byte time type

CS_TIME

time

CS_DATETIME_TYPE

8-byte datetime type

CS_DATETIME

datetime

CS_DATETIME4_TYPE

4-byte datetime type

CS_DATETIME4

smalldatetime

CS_BIGDATETIME_TYPE

8-byte binary type

CS_BIGDATETIME

bigdatetime

CS_BIGTIME_TYPE

8-byte binary type

CS_BIGTIME

bigtime

Numeric types

CS_TINYINT_TYPE

1-byte unsigned integer type

CS_TINYINT

tinyint

CS_SMALLINT_TYPE

2-byte integer type

CS_SMALLINT

smallint

CS_INT_TYPE

4-byte integer type

CS_INT

int

CS_BIGINT_TYPE

8-byte integer type

CS_BIGINT

bigint

CS_USMALLINT_TYPE

2-byte unsigned integer type

CS_USMALLINT

usmallint

CS_UINT_TYPE

4-byte unsigned integer type

CS_UINT

uint

CS_UBIGINT_TYPE

8-byte unsigned integer type

CS_UBIGINT

ubigint

CS_DECIMAL_TYPE

Decimal type

CS_DECIMAL

decimal

CS_NUMERIC_TYPE

Numeric type

CS_NUMERIC

numeric

CS_FLOAT_TYPE

8-byte float type

CS_FLOAT

float

CS_REAL_TYPE

4-byte float type

CS_REAL

real

Money types

CS_MONEY_TYPE

8-byte money type

CS_MONEY

money

CS_MONEY4_TYPE

4-byte money type

CS_MONEY4

smallmoney

Text and image types

CS_TEXT_TYPE

Text type

CS_TEXT

text

CS_IMAGE_TYPE

Image type

CS_IMAGE

image

CS_UNITEXT_TYPE

Variable-length character type

CS_UNITEXT

unitext