Type Indicators in a Microsoft SQL Server Provider

This table shows how a Microsoft SQL Server provider might map its data types to OLE DB data types.

Microsoft SQL Server data type OLE DB type indicator
char [(n)] (1 ≤ n ≤ 255) DBTYPE_STR
varchar [(n)] (1 ≤ n ≤ 255) DBTYPE_STR
binary [(n)] (1 ≤ n ≤ 255) DBTYPE_BYTES
varbinary [(n)] (1 ≤ n ≤ 255) DBTYPE_BYTES
numeric [(p[,s])] DBTYPE_NUMERIC
decimal [(p[,s])] DBTYPE_NUMERIC
Tinyint DBTYPE_UI1
Smallint DBTYPE_I2
Int DBTYPE_I4
Real DBTYPE_R4
float [(n)] DBTYPE_R8
Smalldatetime DBTYPE_DATE, DBTYPE_DBTIMESTAMP
Datetime DBTYPE_DATE, DBTYPE_DBTIMESTAMP
Timestamp DBTYPE_BYTES (DBCOLUMNFLAGS_ISROWVER is set)
text (≤ 2**31 bytes) DBTYPE_STR
image (≤ 2**31 bytes) DBTYPE_BYTES
Smallmoney DBTYPE_CY
Money DBTYPE_CY
user-defined-type DBTYPE_UDT