Udostępnij za pośrednictwem


SQLBindParameter

SQLBindParameter can eliminate the burden of data conversion when used to provide data for the SQL Native Client 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.

Note

When inserting char and wchar type data into an image column, the size of the data being passed in is used, as opposed to the size of the data after conversion to a binary format.

If the SQL Native Client 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 rows of parameters generating errors can be determined from the array.

When using the SQL Native Client ODBC driver, 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 Native Client 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 reports the number of rows processed before the error occurs. The application can then traverse its parameter status array to discover the number of statements successfully executed, if necessary.

See Also

Concepts

ODBC API Implementation Details

Other Resources

SQLBindParamter Function

Help and Information

Getting SQL Server 2005 Assistance