SQLSTATE error codes

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 12.2 and above

All error classes returned by Azure Databricks are associated with a 5 character SQLSTATE. A SQLSTATE is a SQL standard encoding for error conditions commonly used by JDBC, ODBC, and other client APIs.

A SQLSTATE consists of two portions: A two character class, and a three character subclass. Each character must be a digit '0' to '9' or 'A' to 'Z'.

While many SQLSTATE values are prescribed by the SQL standard, others are common in the industry, specific to Spark, or Azure Databricks.

Where necessary Spark and Azure Databricks use the 'KD' class and 'K**' subclass ranges for custom SQLSTATEs. The class 'XX' is used for internal errors warranting a bug report.

For an ordered list of error classes see: Error handling in Azure Databricks

Azure Databricks uses the following SQLSTATE classes:

Class 01: warning

SQLSTATE Description and issuing error conditions
01000 warning

Class 02: no data

SQLSTATE Description and issuing error conditions
02000 no data

Class 07: dynamic SQL error

SQLSTATE Description and issuing error conditions
07001 using clause does not match dynamic parameter specifications
07501 The option specified on PREPARE or EXECUTE is not valid.

Class 08: connection exception

SQLSTATE Description and issuing error conditions
08000 connection exception
08001 SQL-client unable to establish SQL-connection
08003 connection does not exist
08004 SQL-server rejected establishment of SQL-connection
08006 connection failure
08KD1 server busy

Class 0A: feature not supported

SQLSTATE Description and issuing error conditions
0A000 feature not supported