dbprtype

DB Library for C

DB Library for C

dbprtype

Converts a Microsoft® SQL Server™ 2000 token value to a readable string.

Syntax

LPCSTR dbprtype ( INT token );

Arguments

token

Is the SQL Server token value.

Returns

A pointer to a null-terminated string that is the readable translation of the SQL Server token value. The pointer points to space that is never overwritten, so it is safe to call this function more than once in the same statement. If the token is unknown, the function returns a pointer to an empty string. The strings correspond to SQL Server data type names.

Remarks

Functions such as dbcoltype and dbalttype return SQL Server token values. To print out what the token value means, use dbprtype.

The following token values are used by dbprtype.

Token value Data type
SQLINT1 tinyint
SQLINT2 smallint
SQLINT4 int
SQLMONEY money
SLQFLT8 float
SQLDATETIME datetime
SQLBIT bit
SQLCHAR char
SQLVARCHAR varchar
SQLTEXT text
SQLBINARY binary
SQLVARBINARY varbinary
SQLIMAGE image
SQLDECIMAL decimal
SQLNUMERIC numeric
SQLINTN integer-null
SQLDATETIMN datetime-null
SQLMONEYN money-null
SQLFLTN float-null
SQLAOPSUM sum
SQLAOPAVG avg
SQLAOPCNT count
SQLAOPMIN min
SQLAOPMAX max
SQLDATETIM4 smalldatetime
SQLMONEY4 smallmoney
SQLFLT4 real

See Also

dbaltop

DB-Library for C Data Types

dbalttype

New Features in Transact-SQL

dbcoltype