Sets the total number of columns found in the user file for use with a bulk copy into or out of SQL Server.
can be used instead of bcp_setbulkmode bcp_columns and bcp_colfmt.
RETCODE bcp_columns (
Is the bulk copy-enabled ODBC connection handle.
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 SQL Server 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.
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_columns, you must call bcp_colfmtfor each column in the user file to completely define a custom file format.
Did you find this helpful?
( 1500 characters remaining)
Thank you for your feedback