These two tables list the datatype code numbers and matching datatype names returned
by sp_columns and sp_column_privileges in the
data_type column. The source for the description is the Open Database
Connectivity (ODBC) Application Programming Interface (API).
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
|
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
|