Skip to content

Latest commit

 

History

History
59 lines (42 loc) · 3.06 KB

File metadata and controls

59 lines (42 loc) · 3.06 KB
title IRowsetFastLoad::Commit (OLE DB driver)
description Learn how the IRowsetFastLoad::Commit method marks the end of a batch of inserted rows and writes them to a SQL Server table in OLE DB Driver for SQL Server.
author David-Engel
ms.author davidengel
ms.date 06/14/2018
ms.service sql
ms.subservice connectivity
ms.topic reference
ms.custom
ignite-2025
helpviewer_keywords
Commit method
apiname IRowsetFastLoad::Commit (OLE DB)
apitype COM

IRowsetFastLoad::Commit (OLE DB)

[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics PDW FabricSQLDB]

[!INCLUDEDriver_OLEDB_Download]

Marks the end of a batch of inserted rows and writes the rows to the [!INCLUDEssNoVersion] table. For samples, see Bulk Copy Data Using IRowsetFastLoad (OLE DB) and Send BLOB Data to SQL SERVER Using IROWSETFASTLOAD and ISEQUENTIALSTREAM (OLE DB).

Syntax

  
HRESULT Commit(  
      BOOL fDone);  

Arguments

fDone[in]
If FALSE, the rowset maintains validity and can be used by the consumer for additional row insertion. If TRUE, the rowset loses validity and no further insertion can be done by the consumer.

Return Code Values

S_OK
The method succeeded and all inserted data has been written to the [!INCLUDEssNoVersion] table.

E_FAIL
A provider-specific error occurred. Retrieve error information for the specific error text from the provider.

E_UNEXPECTED
The method was called on a bulk copy rowset previously invalidated by the IRowsetFastLoad::Commit method.

Remarks

An OLE DB Driver for SQL Server bulk copy rowset behaves as a delayed-update mode rowset. As the user inserts row data through the rowset, inserted rows are treated in the same fashion as pending inserts on a rowset supporting IRowsetUpdate.

The consumer must call the Commit method on the bulk copy rowset to write inserted rows to the [!INCLUDEssNoVersion] table in the same way as the IRowsetUpdate::Update method is used to submit pending rows to an instance of SQL Server.

If the consumer releases its reference on the bulk copy rowset without calling the Commit method, all inserted rows not previously written are lost.

The consumer can batch inserted rows by calling the Commit method with the fDone argument set to FALSE. When fDoneis set to TRUE, the rowset becomes invalid. An invalid bulk copy rowset supports only the ISupportErrorInfo interface and IRowsetFastLoad::Release method.

See Also

IRowsetFastLoad (OLE DB)