| title | bcp_batch | Microsoft Docs | |
|---|---|---|
| ms.custom | ||
| ms.date | 03/14/2017 | |
| ms.prod | sql-server-2016 | |
| ms.reviewer | ||
| ms.suite | ||
| ms.technology |
|
|
| ms.tgt_pltfrm | ||
| ms.topic | reference | |
| apiname |
|
|
| apilocation |
|
|
| apitype | DLLExport | |
| helpviewer_keywords |
|
|
| ms.assetid | 0bda489e-86bc-4a7e-80f6-96047e03f281 | |
| caps.latest.revision | 29 | |
| author | JennieHubbard | |
| ms.author | jhubbard | |
| manager | jhubbard |
[!INCLUDESNAC_Deprecated]
Commits all rows previously bulk copied from program variables and sent to [!INCLUDEssNoVersion] by bcp_sendrow.
DBINT bcp_batch (HDBC
hdbc);
hdbc
Is the bulk copy-enabled ODBC connection handle.
The number of rows saved after the last call to bcp_batch, or -1 in case of error.
Bulk copy batches define transactions. When an application uses bcp_bind and bcp_sendrow to bulk copy rows from program variables to SQL Server tables, the rows are committed 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 in incoming data (as in a telemetry application). If an application does not call bcp_batch the bulk copied rows are committed only when bcp_done is called.