Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 1.89 KB

File metadata and controls

28 lines (22 loc) · 1.89 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords apitype
SQLRowCount
SQLRowCount
markingmyname
maghan
03/14/2017
sql
native-client
reference
SQLRowCount function
DLLExport

SQLRowCount

[!INCLUDESQL Server Azure SQL Database Synapse Analytics PDW]

When arrays of parameter values are bound for statement execution, SQLRowCount returns SQL_ERROR if any row of parameter values generates an error condition in statement execution. No value is returned through the RowCountPtr argument of the function.

The application can take advantage of the SQL_ATTR_PARAMS_PROCESSED_PTR statement attribute to capture the number of parameters processed prior to the error occurring.

Further, the application can use an array of status values, bound by using the SQL_ATTR_PARAM_STATUS_PTR statement attribute, to capture the array offsets of offending parameter rows. The application can traverse the status array to determine the actual number of rows processed.

When a [!INCLUDEtsql] INSERT, UPDATE, DELETE, or MERGE statement with an OUTPUT clause is executed, SQLRowCount will not return the count of rows affected until all the rows in the result set generated by the OUTPUT clause have been consumed. To consume these rows, you call SQLFetch or SQLFetchScroll. SQLResultCols will return -1 until all result rows have been consumed. After SQLFetch or SQLFetchScroll returns SQL_NO_DATA, the application must call SQLRowCount to determine the number of rows affected before calling SQLMoreResults to move to the next result.

See Also

SQLRowCount Function
ODBC API Implementation Details