Skip to content

Latest commit

 

History

History
50 lines (37 loc) · 2.18 KB

File metadata and controls

50 lines (37 loc) · 2.18 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords apilocation apiname apitype
bcp_columns
bcp_columns
markingmyname
maghan
03/14/2017
sql
native-client
reference
bcp_columns function
sqlncli11.dll
bcp_columns
DLLExport

bcp_columns

[!INCLUDESQL Server Azure SQL Database Synapse Analytics PDW]

Sets the total number of columns found in the user file for use with a bulk copy into or out of [!INCLUDEssNoVersion]. bcp_setbulkmode can be used instead of bcp_columns and bcp_colfmt.

Syntax

  
RETCODE bcp_columns (  
        HDBC hdbc,  
        INT nColumns);  

Arguments

hdbc
Is the bulk copy-enabled ODBC connection handle.

nColumns
Is the total number of columns in the user file. Even if you are preparing to bulk copy data from the user file to an [!INCLUDEssNoVersion] table and do not intend to copy all columns in the user file, you must still set nColumns to the total number of user-file columns.

Returns

SUCCEED or FAIL.

Remarks

This function can be called only after bcp_init has been called with a valid file name.

You should call this function only if you intend to use a user-file format that differs from the default. For more information about a description of the default user-file format, see bcp_init.

After calling bcp_columns, you must call bcp_colfmt for each column in the user file to completely define a custom file format.

See Also

Bulk Copy Functions