bcp_batch

Saves any rows previously bulk copied from program variables and sent to SQL Server by bcp_sendrow.

Syntax

DBINT bcp_batch ( PDBPROCESS dbproc );

where

dbproc
Is the DBPROCESS structure that is the handle for a particular workstation/ SQL Server process. It contains all the information that DB-Library uses to manage communications and data between the workstation and SQL Server.

Returns

The number of rows saved since the last call to bcp_batch, or -1 in case of error.

Remarks

When an application uses bcp_bind and bcp_sendrow to bulk copy rows from program variables to SQL Server tables, the rows are permanently saved in SQL Server only when the program calls bcp_batch or bcp_done.

You can call bcp_batch once every n rows or when there is a lull between periods of incoming data (as in a telemetry application). Of course, you can choose some other criteria, or you can decide not to call bcp_batch at all. If bcp_batch is not called, the rows are permanently saved in SQL Server when bcp_done is called.

See Also

bcp_bind, bcp_done, bcp_sendrow