Skip to content

Latest commit

 

History

History
111 lines (94 loc) · 3.93 KB

File metadata and controls

111 lines (94 loc) · 3.93 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords apilocation apiname apitype
bcp_gettypename
bcp_gettypename
markingmyname
maghan
03/06/2017
sql
native-client
reference
bcp_gettypename function
sqlncli11.dll
bcp_gettypename
bcp_gettypenameA
bcp_gettypenameW
DLLExport

bcp_gettypename

[!INCLUDESQL Server Azure SQL Database Synapse Analytics PDW]

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

Syntax

  
RETCODE bcp_gettypename (  
        INT token,  
        DBBOOL fIsMaxType);  

Unicode and ANSI names:

  • bcp_gettypenameA (ANSI)
  • bcp_gettypenameW (Unicode)

Arguments

token
A value indicating a BCP type token.

field
Indicates if token requested is a max type.

Returns

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

Remarks

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

The following table specifies the possible BCP types, whether they're 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

bcp_gettypename Support for Enhanced Date and Time Features

The token parameter values for date/time types are described in the "Type in sqlncli.h" column of the table in Bulk Copy Changes for Enhanced Date and Time Types (OLE DB and ODBC). The returned value is in the corresponding row of the "File storage type" column.

For more information, see Date and Time Improvements (ODBC).

See Also

Bulk Copy Functions