SQLBindParameter

ODBC and SQL Server

ODBC and SQL Server

SQLBindParameter

SQLBindParameter can eliminate the burden of data conversion when used to provide data for the Microsoft® SQL Server™ ODBC driver, resulting in significant performance gains for both the client and server components of applications. Other benefits include reduced loss of precision when inserting or updating approximate numeric data types.

If the SQL Server ODBC driver encounters an error on a single array element of an array of parameters, the driver continues to execute the statement for the remaining array elements. If the application has bound an array of parameter status elements for the statement, the row(s) of parameters generating errors can be determined from the array.

When using the SQL Server ODBC driver version 3.7 or later, specify SQL_PARAM_INPUT when binding input parameters. Only specify SQL_PARAM_OUTPUT or SQL_PARAM_INPUT_OUTPUT when binding stored procedure parameters defined with the OUTPUT keyword.

SQLRowCount is unreliable with the SQL Server ODBC driver if an array element of a bound-parameter array causes an error in statement execution. The ODBC statement attribute SQL_ATTR_PARAMS_PROCESSED_PTR will report the number of rows processed prior to the error occurring. The application can then traverse its parameter status array to discover the number of statements successfully executed, if necessary.