Error codes
17,269
Database Engine error numbers
sql server / error codes
SQL Server error codes are numbered Database Engine messages that describe a condition or failure. Search the code to find its message and severity, then check the error log and state for the runtime cause.
Error codes
17,269
Database Engine error numbers
Event logged
1,429
Marked by SQL Server for Windows event logging
Microsoft pages
344
Errors with a dedicated source page
Data checked
Jul 13, 2026
73,392 source rows parsed
Search by number, severity, category, or message text.
sys.messages contains one row for each installed message ID and language. Message IDs below 50,000 are system messages. Language ID 1033 is US English; use an installed language ID when you need other text.
Returns the local error number, severity, event-log flag, and message text.
List installed SQL Server messages
T-SQL · 8 lines
Change 18456 to the error number you need.
Look up one SQL Server error number
T-SQL · 10 lines
Source: Microsoft sys.messages documentation. The view is available to the public database role, subject to metadata visibility.
The error number identifies the message family. Severity classifies the type of problem. State adds error-specific context about where or why the message was raised. There is no one state table that applies to every error number.
Error 18456 states describe login-failure reasons. A state value on another error can mean something completely different.
The is_event_logged bit marks messages written to the Windows application log when raised. The SQL Server error log can hold more surrounding engine detail.
These answers add a DBA-reviewed first check to the Microsoft catalog message. Use the search above for every other code in the current 17,269-error snapshot.
SQL Server error 18456
SQL Server rejected a login attempt. The client message hides the exact authentication reason, so the state in the matching SQL Server error-log entry is the useful diagnostic detail.
Catalog message
Login failed for user '%.*ls'.%.*ls%.*ls
Find the error-log entry at the same timestamp and read the login name, state, client address, and reason text. Then confirm that the application reached the intended instance and database.
The result should include the state and reason that the client message omits.
Find error 18456 in the SQL Server error log
T-SQL · 10 lines
xp_readerrorlog is useful for an administrator's targeted log review. Access normally needs elevated server permissions.
SQL Server error 9002
SQL Server cannot reuse or extend enough transaction-log space for the current work. The reported reason and sys.databases.log_reuse_wait_desc determine the next check.
Catalog message
The transaction log for database '%ls' is full due to '%ls' and the holdup lsn is %S_LSN.
Check log_reuse_wait_desc, current log use, the file's configured maximum size, free space on the volume, the recovery model, and the last successful log backup before changing file size.
Replace YourDatabase with the affected database. Both queries read current catalog and log-space information.
Check why the transaction log cannot be reused
T-SQL · 15 lines
sys.dm_db_log_space_usage can require VIEW DATABASE STATE or the equivalent permission for the SQL Server version in use.
SQL Server error 1205
Two or more transactions formed a lock cycle, and SQL Server rolled back one transaction so the others could continue. Error 1205 names the victim; the deadlock graph shows the statements, objects, indexes, and lock modes involved.
Catalog message
Transaction (Process ID %d) was deadlocked on %.*ls resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
Pull the deadlock XML from system_health and map every process in the graph to its application action. Review object access order, transaction scope, execution plans, and retry behavior together.
The built-in system_health session captures deadlock XML on supported SQL Server versions.
Read recent deadlock graphs from system_health
T-SQL · 16 lines
Reading server Extended Events targets requires server-level visibility permissions that vary by SQL Server version.
All three messages point to the I/O path, but they describe different observations. Error 823 is an operating-system I/O failure. Error 824 is a logical consistency failure after Windows reported success. Error 825 means a read worked only after retrying.
| Error | What SQL Server observed | Why it matters | First evidence |
|---|---|---|---|
| 823 | A Windows I/O API returned an operating-system error to SQL Server. | The storage or operating-system path could not complete the read or write request. | SQL Server error log, Windows System log, OS error code, file, offset, and operation. |
| 824 | Windows reported a successful transfer, but SQL Server found a logical page-consistency problem. | The page content, file system, driver, firmware, or storage path failed SQL Server's consistency checks. | Error log, msdb.dbo.suspect_pages, DBCC CHECKDB output, file, page, and affected volume. |
| 825 | A read succeeded only after SQL Server retried it one or more times. | The immediate query survived, but the storage path may still cause data loss or corruption. | SQL Server error log, Windows System log, disk, controller, array, and driver diagnostics. |
Error 823
The operating system returned error %ls to SQL Server during a %S_MSG at offset %#016I64x in file '%ls'. Additional messages in the SQL Server error log and operating system error log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
Error 824
SQL Server detected a logical consistency-based I/O error: %ls. It occurred during a %S_MSG of page %S_PGID in database ID %d at offset %#016I64x in file '%ls'. Additional messages in the SQL Server error log or operating system error log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see [https://go.microsoft.com/fwlink/?linkid=2252374](https://go.microsoft.com/fwlink/?linkid=2252374).
Error 825
A read of the file '%ls' at offset %#016I64x succeeded after failing %d time(s) with error: %ls. Additional messages in the SQL Server error log and operating system error log may provide more detail. This error condition threatens database integrity and must be corrected. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
These reads help correlate the error number with database-page and log details. Error-log access normally needs elevated server permissions.
Check suspect pages and the SQL Server error log
T-SQL · 15 lines
SQL Server error 2627
An INSERT or UPDATE produced a key value that already exists under a primary-key or unique constraint. The message normally names the constraint, object, and duplicate key value.
Catalog message
Violation of %ls constraint '%.*ls'. Cannot insert duplicate key in object '%.*ls'. The duplicate key value is %ls.
Capture the full message and the submitted values. Find the named constraint or unique index, then check whether the request is a duplicate submission, an application race, an identity-range problem, or an expected upsert path.
SQL Server error 208
SQL Server could not resolve the table, view, synonym, or other referenced object in the statement's current database and schema context.
Catalog message
Invalid object name '%.*ls'.
Capture the exact submitted SQL and verify the connected server, database, schema, and object name. Then check deployment state, case sensitivity, temporary-table scope, and metadata visibility for the executing principal.
SQL Server error 229
The current execution context lacks the named permission on the object, schema, or database reported in the message.
Catalog message
The %ls permission was denied on the object '%.*ls', database '%.*ls', schema '%.*ls'.
Record the login, database user, database, object, permission name, application, and module that raised the error. Check direct grants and denies, role membership, ownership chaining, impersonation, and module signing before adding access.
SQL Server error 245
SQL Server tried to convert a value to another data type and at least one input could not be represented in the target type.
Catalog message
Conversion failed when converting the %ls value '%.*ls' to data type %ls.
Capture the exact value, source column or parameter, target type, and full expression. Check implicit conversions introduced by joins, CASE expressions, UNION branches, comparisons, and parameter types.
SQL Server error 207
SQL Server could not bind a referenced column name while compiling the statement. The name, database schema, alias scope, or deployed object definition does not match the submitted SQL.
Catalog message
Invalid column name '%.*ls'.
Capture the exact batch, connected database, and object definition. Verify spelling and case, then check deployment order and whether a SELECT-list alias is being referenced before that alias is available.
SQL Server error 102
SQL Server could not parse the submitted T-SQL batch. The token named in the message is where parsing stopped, which can be after the original missing comma, quote, bracket, alias, or keyword.
Catalog message
Incorrect syntax near '%.*ls'.
Capture the exact SQL sent to the server, including generated dynamic SQL and parameter placeholders. Check the text immediately before the named token and compare the syntax with the target SQL Server version and compatibility level.
The catalog explains the message template. The actual occurrence needs its timestamp and caller context.
01
Capture the complete exception, failed job step, submitted statement, parameters, server, and database.
02
Match the timestamp and error number. Read the lines before and after it for state, file, database, login, or engine context.
03
Correlate service, storage, driver, cluster, and operating-system events from the same window.
04
Use error_reported, deadlock, or a focused session when the event is repeatable and the ordinary logs omit caller detail.
05
Record the login, database user, application name, host, session, transaction, and database state.
06
Check deployments, permission changes, failovers, patches, storage events, and job timing around the first occurrence.
These are site-created navigation groups, not an official Microsoft error taxonomy. Use them when you know the type of problem but not the exact code.
7,346 errors
Database Engine messages that do not fit one of the narrower navigation groups.
Examples #165 #184 #187 #192
2,325 errors
T-SQL parsing, object, column, variable, identifier, procedure, and function messages.
Examples #208 #207 #102 #101
1,698 errors
Login, access, credential, certificate, principal, user, and permission messages.
Examples #18456 #2627 #229 #218
1,355 errors
Messages mentioning replicas, failover, endpoints, mirroring, clustering, listeners, or Always On state.
Examples #341 #369 #548 #666
1,206 errors
Messages involving disk, log space, tempdb, memory, workers, quotas, or configured limits.
Examples #9002 #103 #105 #106
1,041 errors
Messages involving locks, blocking, query execution, workers, waits, plans, or concurrency.
Examples #159 #172 #288 #304
875 errors
Version, compatibility, edition, deprecated behavior, and feature-support messages.
Examples #245 #125 #206 #210
749 errors
High-severity I/O, checksum, consistency, DBCC, and storage-related messages.
Examples #823 #824 #825 #21
664 errors
Messages involving backup, restore, recovery, media, files, or the backup chain.
Examples #667 #805 #908 #922
10 errors
Messages raised when sessions form a lock cycle and SQL Server chooses a victim.
Examples #1205 #1231 #3635 #5231
Microsoft publishes the Database Engine catalog in number ranges. Open the matching range when a code has no dedicated Microsoft page.
The error number identifies the Microsoft Database Engine message. This reference covers SQL Server 2016 through 2025 and was last checked Jul 13, 2026.
Capture the state, timestamp, database, object or file name, failing statement, and nearby SQL Server error-log entries. Those values narrow the cause behind the message template.
Use the first checks to collect logs and run read-only queries. Confirm what failed before changing permissions, database files, server settings, or storage.
If the same error keeps returning and the cause is still unclear, send the full message, timestamp, SQL Server version, surrounding log lines, and what changed recently.
Search this page by number or query the sys.messages catalog view on the affected SQL Server instance. The local catalog is useful when the installed build or message language matters.
Severity classifies the type or seriousness of the condition. State gives extra context for a particular error and is specific to that error number. Error 18456, for example, uses state to narrow the login-failure reason.
In SQL Server Management Studio, open Management, SQL Server Logs, then Current. Administrators can also use documented management tools or targeted error-log procedures to read matching entries.
The sys.messages is_event_logged value marks whether SQL Server writes the message to the Microsoft Windows application log when it is raised. Check the SQL Server error log as well because it often contains the surrounding engine detail.
Catalog messages contain placeholders that SQL Server fills at runtime with names, values, files, databases, or operating-system details. Message text can also vary by installed language and SQL Server version.
Error 18456 means the connection reached SQL Server and authentication was rejected. Errors 26, 40, 53, and login timeouts usually point to instance discovery, the SQL Server service, name resolution, protocols, ports, TLS, or firewall rules. Test locally first, then check the SQL Server error log and the 18456 state when authentication is involved.
A query timeout is raised by the client when a command exceeds its configured limit. SQL Server may record an Attention event and error 3617 after the cancellation. Separate it from a connection timeout, then inspect the slow query, blocking, waits, execution plan, and application settings.
Use the SQL Server error log and Windows Application and System logs for server events, SQL Server Agent alerts for selected severities or messages, and Extended Events for problems that need statement or session detail. A centralized monitoring tool helps when several instances need shared retention, filtering, and alert routing.