ODBC datatypes

Table 2-2 and Table 2-3 list the datatype code numbers and matching datatype names returned by sp_columns and sp_sproc_columns in the data_type column. The source for the description is the Open Database Connectivity (ODBC) Application Programming Interface (API).

Table 2-2: Code numbers for ODBC datatypes

Datatype

Code #

char

1

decimal

3

double precision

8

float

6

integer

4

numeric

2

real

7

smallint

5

varchar

12

wchar

-8

wvarchar

-9

wlongvarchar

-10

Table 2-3: Code numbers for extended datatypes

Datatype

Code #

bigint

-5

binary (bit datatype)

-2

bit

-7

date

9

java.lang.Object

1111

long univarchar

-10

long varbinary

-4

long varchar

-1

time

10

timestamp

11

tinyint

-6

unichar

-8

univarchar

-9

varbinary (bit-varying datatype)

-3