| title | C to SQL: Bit | Microsoft Docs | |||
|---|---|---|---|---|
| ms.custom | ||||
| ms.date | 01/19/2017 | |||
| ms.prod | sql | |||
| ms.prod_service | connectivity | |||
| ms.reviewer | ||||
| ms.technology | connectivity | |||
| ms.topic | conceptual | |||
| helpviewer_keywords |
|
|||
| ms.assetid | 267c9fa9-599e-4ee6-b51b-0cae43f09183 | |||
| author | David-Engel | |||
| ms.author | v-daenge |
The identifier for the bit ODBC C data type is:
SQL_C_BIT
The following table shows the ODBC SQL data types to which bit C data may be converted. For an explanation of the columns and terms in the table, see Converting Data from C to SQL Data Types.
| SQL type identifier | Test | SQLSTATE |
|---|---|---|
| SQL_CHAR SQL_VARCHAR SQL_LONGVARCHAR SQL_WCHAR SQL_WVARCHAR SQL_WLONGVARCHAR |
None | n/a |
| SQL_DECIMAL SQL_NUMERIC SQL_TINYINT SQL_SMALLINT SQL_INTEGER SQL_BIGINT SQL_REAL SQL_FLOAT SQL_DOUBLE |
None | n/a |
| SQL_BIT | None | n/a |
The driver ignores the length/indicator value when converting data from the bit C data type and assumes that the size of the data buffer is the size of the bit C data type. The length/indicator value is passed in the StrLen_or_Ind argument in SQLPutData and in the buffer specified with the StrLen_or_IndPtr argument in SQLBindParameter. The data buffer is specified with the DataPtr argument in SQLPutData and the ParameterValuePtr argument in SQLBindParameter.