Export (0) Print
Expand All

bcp_gettypename

Returns the SQL type name for a specified BCP type token.


RETCODE bcp_gettypename (
        INT token,
        DBBOOL fIsMaxType);

token

A value indicating a BCP type token.

field

Indicates if token requested is a max type.

A string containing the SQL type name corresponding to the BCP type. If an invalid BCP type is specified, an empty string is returned..

The BCP type tokens are defined in the sqlncli.h header file and the sqlncli.lib library.

The table below specifies the possible BCP types, whether or not they are max types, and the expected output.

BCP type name MaxType Output

SQLDECIMAL

Either

decimal

SQLNUMERIC

Either

numeric

SQLINT1

Either

tinyint

SQLINT2

Either

smallint

SQLINT4

Either

int

SQLMONEY

Either

money

SQLFLT8

Either

float

SQLDATETIME

Either

datetime

SQLBITN

Either

bit-null

SQLBIT

Either

bit

SQLBIGCHAR

No

char

SQLCHARACTER

No

char

SQLBIGVARCHAR

No

varchar

SQLVARCHAR

No

varchar

SQLTEXT

Either

text

SQLBIGBINARY

No

binary

SQLBINARY

No

binary

SQLBIGVARBINARY

No

varbinary

SQLVARBINARY

No

varbinary

SQLIMAGE

Either

image

SQLINTN

Either

int-null

SQLDATETIMN

Either

datetime-null

SQLMONEYN

Either

money-null

SQLFLTN

Either

float-null

SQLAOPSUM

Either

sum

SQLAOPAVG

Either

avg

SQLAOPCNT

Either

count

SQLAOPMIN

Either

min

SQLAOPMAX

Either

max

SQLDATETIM4

Either

smalldatetime

SQLMONEY4

Either

smallmoney

SQLFLT4

Either

real

SQLUNIQUEID

Either

uniqueidentifier

SQLNCHAR

No

nchar

SQLNVARCHAR

No

nvarchar

SQLNTEXT

Either

ntext

SQLVARIANT

Either

sql_variant

SQLINT8

Either

bigint

SQLCHARACTER

Yes

varchar(max)

SQLBIGCHAR

Yes

varchar(max)

SQLBIGVARCHAR

Yes

varchar(max)

SQLVARCHAR

Yes

varchar(max)

SQLBINARY

Yes

varbinary(max)

SQLBIGBINARY

Yes

varbinary(max)

SQLBIGVARBINARY

Yes

varbinary(max)

SQLVARBINARY

Yes

varbinary(max)

SQLNCHAR

Yes

nvarchar(max)

SQLNVARCHAR

Yes

nvarchar(max)

SQLXML

Yes

xml

SQLUDT

Either

udt

Community Additions

ADD
Show:
© 2014 Microsoft