## 2.2 Handling SQL Errors
Errors generated when executing SQL statements are identified by a code number which may be helpful to find an explanation and solution to the problem.
This section gives some recommended solutions to help solve problems related to SQL errors. The topic which follows 'SQL Error Reference' is a table of error codes which includes links to other sources of information for many of the most frequently occurring errors.
Error messages returned when executing SQL statements are identified by a number, type and description, for example:
ERROR [SQL-608] exceed maximum number of prepared statements
There are currently over 5700 SQL errors; all error codes and types are listed in the monitoring view m_ERROR_CODES. To get a complete list of errors and their descriptions you can execute the following query:
```
SELECT * FROM M_ERROR_CODES ORDER BY CODE ASC;
```
All SQL error messages are also listed in the help topic 'SQL Error Codes' in the SAP HANA SQL Reference Guide for SAP HANA Platform (link in Related Information below).
## Knowledge Base Search
You can search for existing support documentation on a specific error in the SAP HANA Support Knowledge Base and the SAP Support community (see links in Related Information below). For example, the search results for the description of the SQL-608 error given above includes references to many HAN-DB (SAP HANA Database) knowledge base articles such as:
- 2464140 - Longer running realtime replication may provide errors like "exceed maximum number of prepared statements"
- 2154870 - How-To: Understanding and defining SAP HANA Limitations
SQL errors may also be related to third party SAP tools, middleware or application clients that use HANA, and information may therefore be available under other component IDs (not only 'HAN-DB*'). The following error, for example, may occur in the context of 'SAP Access Control 12.0' between SPRO and HANA:
```
ERROR_CODE : 4.229 - ERR_PROVIDER_INVALID_PROVIDER_NAME - 'Invalid provider name'
```
The following KBA (under the component Access Request GRC-SAC-ARQ ) may be relevant but may not be immediately visible in the search results:
- 3002042 - Invalid provider name: 'SAP_PI_GRC'.'Create_User': line xx col xx (at pos xx): line x col xx (at pos xx)
If no solution can be found you may need to open a support ticket under the HAN-DB* component with the example system trace files, logs and screenshots of the error(s) for further analysis.
## Search Trace Files
You can also search the HANA service trace and service alert files (see also 'Analyzing SQL Traces') for example: 'indexserver_saphana01.30003.024.trc', 'indexserver_alert_saphana01.trc'.
For errors in BW on HANA, the values of the following transaction codes may also be helpful:
- The ABAP Dumps in transaction code ST22
- The work process trace entry from transaction code ST11
The following articles may also be helpful when analyzing trace files:
- 2194685 - How to find work process trace for SM21 System Log or ST22 dump
- 2380176 - FAQ: SAP HANA Database Trace
- 2399990 - How-To: Analyzing ABAP Short Dumps in SAP HANA Environments
## Related Information
SQL Error Codes (SAP HANA SQL Reference Guide)
SQL Error Reference [page 12] Analyzing SQL Traces [page 238] SAP HANA Support Knowledge Base
## Links to Knowledge Base Articles :
SAP Note 2194685
SAP Note 2380176
SAP Note 2399990
SAP Note 2464140
SAP Note 2154870
SAP Note 3002042