| title | SQLSTATE (ODBC Error Codes) | Microsoft Docs | |||||
|---|---|---|---|---|---|---|
| ms.custom | ||||||
| ms.date | 03/14/2017 | |||||
| ms.prod | sql | |||||
| ms.prod_service | database-engine, sql-database, sql-data-warehouse, pdw | |||||
| ms.reviewer | ||||||
| ms.technology | native-client | |||||
| ms.topic | reference | |||||
| helpviewer_keywords |
|
|||||
| ms.assetid | 84cce528-edb0-473f-a85f-3eb87fbe2cf3 | |||||
| author | markingmyname | |||||
| ms.author | maghan | |||||
| monikerRange | >=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current |
[!INCLUDEappliesto-ss-asdb-asdw-pdw-md]
SQLSTATE provides detailed information about the cause of a warning or error. For errors that occur in the data source detected and returned by [!INCLUDEssNoVersion], the [!INCLUDEssNoVersion] Native Client ODBC driver maps the returned native error number to the appropriate SQLSTATE. If a native error number does not have an ODBC error code to map to, the [!INCLUDEssNoVersion] Native Client ODBC driver returns SQLSTATE 42000 ("syntax error or access violation"). For errors that are detected by the driver, the [!INCLUDEssNoVersion] Native Client ODBC driver generates the appropriate SQLSTATE.
For more information about the state error codes, see the following topics: