Open In App

SQL Error Messages

Last Updated : 17 Sep, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

SQL error messages are crucial for diagnosing issues in SQL queries and database operations. They provide information about what went wrong during query execution and allow users to troubleshoot and correct problems.

These error messages are often accompanied by error codes that give specific details about the type of error encountered.

SQL Error Messages

  • SQL error messages are feedback provided by a database management system (DBMS) when an issue occurs during the execution of SQL queries or commands.
  • These errors help developers understand what went wrong and why a query failed.
  • SQL error messages typically include an error code, a short description, and sometimes a detailed explanation.

Error Codes 0 and 100

These error codes indicate standard outcomes for SQL operations. SQLCODE 0 denotes a successful execution, while SQLCODE 100 indicates that a query was executed without errors but did not return any rows.

Error CodeDescription
0Successful execution of the SQL statement. No errors occurred.
100No data found; used by some SQL databases to indicate that a query has returned no rows.

Error Codes -1 to -99

This range of error codes includes various general SQL issues, such as syntax errors, data type mismatches and permission problems. Understanding these errors can help diagnose common SQL issues.

Error CodeDescription
-1General SQL error; the specific issue is not defined.
-2Invalid SQL statement or syntax error in the SQL query.
-3Out of memory; the system could not allocate the required memory.
-4Database connection error; unable to establish or maintain a connection.
-5Data type mismatch; trying to insert or process incompatible data types.
-6Numeric overflow; value exceeds the storage capacity.
-7Permission denied; user lacks necessary privileges for the operation.
-8Constraint violation; such as a unique constraint or foreign key constraint failure.
-9Invalid operation; performing an operation that is not allowed.
-10Deadlock; two or more transactions are waiting for each other to release locks.
-11Timeout; the operation took longer than the permitted time limit.
-12Data integrity issue; corruption or mismatch in data.
-13Invalid index; referring to a non-existent or incorrect index.
-14Unspecified SQL error; general error with no specific cause.
-15Authentication error; issues with user credentials or login.
-16Database not found; the specified database does not exist.
-17Query execution error; issues encountered during SQL query execution.

Error Codes -101 to -399

This range includes more specific SQL error messages related to feature support, query execution, and data integrity. They can provide insights into advanced SQL issues and database feature limitations.

Error CodeDescription
-101Syntax error; the SQL statement contains incorrect syntax.
-102Incorrect or missing keyword in the SQL statement.
-103Unexpected token; encountered an unrecognized or invalid character.
-104Column not found; attempting to access a non-existent column.
-105Table not found; specified table does not exist.
-106Function or stored procedure not found; non-existent function or procedure.
-107Invalid operation on an open cursor; operation not permitted.
-108Incorrect data length; data does not fit in the specified length.
-109Invalid constraint definition; issues with constraints in the database schema.
-110Unsupported SQL feature; the SQL feature is not available in the current environment.
-111Invalid data conversion; error during type conversion operations.
-112Incorrect use of a JOIN operation; issues with table joins.
-113Missing or incorrect transaction handling; issues with commits or rollbacks.
-114Invalid user-defined function or procedure; issues with user-defined objects.
-115Referential integrity error; issues with foreign key relationships.
-116Invalid use of GROUP BY or ORDER BY clauses; incorrect query grouping or ordering.
-117Error in aggregate function; issues with aggregation operations.
-118Lock contention; conflicts with other transactions locking resources.
-119Invalid sequence or identity column operation; issues with sequence generation.
-120Error during data insertion; issues encountered while inserting data.

Error Codes -400 to -500

Error CodeDescription
-400General SQL error; often due to syntax or database access issues.
-401Invalid SQL statement; unsupported command or syntax error.
-402Data type mismatch; incompatible data types used in operations.
-403Numeric value out of range; overflow or underflow condition.
-404Null value not allowed; attempting to insert a null where not permitted.
-405Invalid SQL function call; issues with SQL functions.
-406Arithmetic overflow; overflow during calculations.
-407Mandatory field missing; null value where not allowed.
-408Invalid string length; data exceeds defined length.
-409Invalid use of parentheses; issues with SQL query structure.
-410Invalid data conversion; error during data type conversions.
-411Null value encountered; null where not permitted in operations.
-412Invalid comparison; comparing incompatible data types.
-413Divide by zero error; division operation with zero divisor.
-414Invalid cursor operation; issues with cursor handling.
-415Referential integrity violation; foreign key constraint failure.
-416Unsupported SQL statement; SQL statement not supported in current environment.
-417Deadlock detected; conflicting resource locks.
-418Invalid table or column reference; missing or incorrect alias.
-419Ambiguous column reference; unresolved column names.
-420Syntax error in SQL; missing or incorrect elements in SQL query.
-421Incorrect privilege; operation not permitted due to permissions.
-422Constraint violation; unique or check constraint failure.
-423Invalid data type conversion; issues with casting data types.
-424Invalid transaction state; incorrect operation context.
-425Invalid parameter count; incorrect number of parameters.
-426Permission denied; operation not allowed due to lack of privileges.
-427Memory allocation error; insufficient resources for query.
-428Invalid join condition; issues with SQL join operations.
-429Incorrect use of aggregates; improper aggregation in queries.
-430Invalid identifier; unknown or invalid SQL identifier.
-431Exceeded maximum length; string or identifier too long.
-432Use of reserved word; invalid use of SQL keywords.
-433Transaction rollback; failure or timeout in transaction.
-434Cursor already closed; operation attempted on a closed cursor.
-435Incorrect subquery use; issues with nested queries.
-436Invalid subquery reference; incorrect context for subqueries.
-437Data type conversion failed; incompatible types during conversion.
-438Query execution timeout; long-running query exceeded time limit.
-439Invalid trigger operation; recursive or incorrect trigger use.
-440User-defined function not found; function or procedure missing.
-441Incorrect arguments; wrong number of arguments for function.
-442Invalid foreign key relationship; issues with foreign keys.
-443Incorrect aggregate use; invalid use of aggregation functions.
-444Invalid SQL join; issues with join conditions.
-445Illegal view or table modification; modification not permitted.
-446Integrity constraint violation; issues with data constraints.
-447Invalid index; issues with database indexing.
-448SQL parsing error; issues with SQL query structure.
-449Memory overflow; excessive query size or result set.
-450Division by zero; mathematical operation with zero divisor.
-451Invalid nested query use; issues with nested or correlated queries.
-452Result set cursor state error; issues with cursor result set.
-453Transaction failure; lock conflict or concurrency issue.
-454Invalid SQL operation; disallowed operation in current state.
-455Integrity constraint violation; unique or primary key issues.
-456Invalid column reference; missing or incorrect column in SQL.
-457Invalid aggregation; issues with SQL grouping or aggregation.
-458Incorrect DISTINCT use; invalid use in multi-table queries.
-459Deadlock detected; conflicting transaction locks.
-460User-defined function issues; problems with function use.
-461Ambiguous column reference; unresolved column names in query.
-462Data type mismatch; incompatible types during operations.
-463Reserved keyword use; invalid SQL keyword usage.
-464Cursor already open; attempted to open an already open cursor.
-465Foreign key constraint violation; broken foreign key references.
-466Query timeout; long-running query exceeded time limit.
-467Syntax error; incorrect query structure or syntax issue.
-468Invalid SQL feature; unsupported feature in the database.
-469Memory allocation issue; failure to allocate memory for query.
-470Invalid view or table operation; issues with views or tables.
-471SQL statement execution error; general execution issue.
-472Data integrity issue; problems with data consistency.
-473Invalid index usage; issues with database indexing.
-474Invalid column definition; incorrect column specification.
-475Incorrect query results; issues with query execution.
-476Invalid use of aggregate functions; improper aggregation.
-477Syntax error in query; issues with SQL query formatting.
-478Invalid subquery; issues with subquery usage.
-479Referential integrity violation; foreign key issues.
-480Invalid column name; non-existent or incorrect column name.

WinSock Error Codes -10050 to -11002

Error CodeDescription
-10050Network is down; unable to reach the specified network.
-10051Network unreachable; the network cannot be reached.
-10052Connection aborted; the connection was terminated.
-10053Software caused connection abort; connection was aborted by the software.
-10054Connection reset by peer; the connection was reset by the remote host.
-10055No buffer space available; insufficient resources to complete the operation.
-10056Socket is already connected; attempt to connect already connected socket.
-10057Socket is not connected; operation attempted on a disconnected socket.
-10058Cannot send after socket shutdown; send operation attempted after socket was shut down.
-10059Too many references; cannot join or connect the specified socket.
-10060Connection timed out; the attempt to connect timed out.
-10061Connection refused; no connection could be made because the target machine actively refused it.
-10062Too many levels of symbolic links; too many symbolic links encountered.
-10063File name too long; the file name or path is too long.
-10064Host is down; the remote host is down.
-10065No route to host; no route to the specified host.
-10066Directory not empty; the directory is not empty.
-10067Too many files open; the system has too many open files.
-10068Operation canceled; operation was canceled.
-10069Invalid argument; invalid argument passed to a function.
-10070Operation not supported; the operation is not supported.
-10071Address family not supported; the address family is not supported.
-10072Protocol not supported; the protocol is not supported.
-10073Protocol type not supported; the protocol type is not supported.
-10074Operation not supported; the operation is not supported.
-10075Protocol error; protocol error occurred.
-10076Operation not supported; the requested operation is not supported.
-10077Address family not supported; address family is not supported.
-10078Protocol family not supported; protocol family is not supported.
-10079Socket operation on non-socket; attempted to perform an operation on a non-socket.
-10080Message size too long; the message is too long.
-10081Network reset; network connection was reset.
-10082Socket is already connected; the socket is already connected.
-10083No buffer space available; no buffer space available to complete the operation.
-10084Connection aborted; the connection was aborted.
-10085Connection reset; the connection was reset.
-10086Connection refused; no connection could be made.
-10087No such host; the host does not exist.
-10088Address already in use; the address is already in use.
-10089No such process; no such process exists.
-10090Cannot assign requested address; the address cannot be assigned.
-10091Network unreachable; network cannot be reached.
-10092Network down; the network is down.
-10093Operation timed out; the operation timed out.
-10094Network unreachable; the network is unreachable.
-10095Network reset; the network connection was reset.
-10096Protocol not available; the protocol is not available.
-10097No buffer space available; not enough buffer space available.
-10098Network unreachable; cannot reach the network.
-10099Network reset; network connection was reset.
-100100Connection refused; connection was refused by the peer.
-100101Connection aborted; the connection was aborted.
-100102Connection reset by peer; the connection was reset by the peer.
-100103Connection timed out; the connection attempt timed out.
-100104Connection refused; the connection was refused.
-100105No buffer space available; insufficient buffer space available.
-100106Address family not supported; the address family is not supported.
-100107Protocol family not supported; the protocol family is not supported.
-100108Protocol not supported; the protocol is not supported.
-100109Network unreachable; the network cannot be reached.
-100110No route to host; no route to the specified host.
-100111Host is down; the remote host is down.
-100112Network reset; network connection was reset.
-100113Network unreachable; the network is unreachable.
-100114No buffer space available; insufficient buffer space available.
-100115Network down; the network is down.
-100116Network unreachable; the network cannot be reached.
-100117Address already in use; the address is already in use.
-100118Connection refused; the connection was refused.
-100119Address family not supported; the address family is not supported.
-100120Protocol not supported; the protocol is not supported.
-100121No buffer space available; no buffer space available.
-100122Network down; network is down.
-100123Network reset; network connection was reset.
-100124Address family not supported; the address family is not supported.
-100125Protocol family not supported; the protocol family is not supported.
-100126Address already in use; address is already in use.
-100127Connection refused; connection was refused by the peer.
-100128Connection reset by peer; connection was reset by the peer.
-100129No buffer space available; insufficient buffer space available.
-100130Network unreachable; network cannot be reached.
-100131Network down; the network is down.
-100132Protocol family not supported; the protocol family is not supported.
-100133Address already in use; address is already in use.
-100134Connection refused; connection was refused.
-100135Network reset; network connection was reset.
-100136Network unreachable; the network is unreachable.
-100137Address family not supported; the address family is not supported.
-100138Protocol not supported; the protocol is not supported.
-100139Connection aborted; connection was aborted.
-100140Connection reset by peer; the connection was reset by the peer.
-100141Network down; the network is down.
-100142Network unreachable; network cannot be reached.
-100143Address already in use; the address is already in use.
-100144Connection refused; the connection was refused.
-100145Network reset; network connection was reset.
-100146No buffer space available; no buffer space available.
-100147Address family not supported; the address family is not supported.
-100148Protocol family not supported; the protocol family is not supported.
-100149Protocol not supported; the protocol is not supported.
-100150Network down; the network is down.
-100151Network unreachable; network cannot be reached.

Conclusion

SQL and network error codes are crucial for diagnosing and resolving issues in database systems and network communications. By understanding these codes, you can effectively troubleshoot problems and maintain the health of your systems.


Next Article

Similar Reads