SqlBCPColumns%

Sets the total number of columns in the operating-system file for a bulk copy into or out of SQL Server.

Syntax

SqlBCPColumns% ( sqlconn%, colcount% )

where

sqlconn%
Is a SQL Server connection. The value of sqlconn% is returned by SqlOpen%.
colcount%
Is the total number of columns in the operating-system file. Note that even when you are bulk-copying data from the operating-system file to a SQL Server table and do not intend to copy all the columns in the operating-system file, you must still set colcount% to the total number of columns in the operating-system file.

Returns

SUCCEED (1) or FAIL (0).

Remarks

SqlBCPColumns% can be called only after you call SqlBCPInit% with a valid filename.

Call this function only when you intend to use a format for an operating-system file that differs from the default format. For a description of the default format for an operating-system file, see SqlBCPInit%.

After calling SqlBCPColumns%, you must call SqlBCPColfmt% colcount% times because you are defining a custom file format.

See Also

SqlBCPColfmt%, SqlBCPColumnFormat%, SqlBCPInit%