SQL Server engine errors

Database Engine15 error codes

Reference list of 15 SQL Server engine errors with meanings, common causes, and related context.

About SQL Server engine errors

SQL Server engine errors are identified by a numeric error number paired with a severity level (0–25). The error number pinpoints the specific failure (such as 2627 for a primary key violation or 18456 for a login failure), while the severity level classifies the nature and urgency of the problem.

Severity levels follow a consistent pattern: 0–10 are informational messages, 11–16 are errors that the developer or user can correct (syntax errors, constraint violations, permission issues), 17–19 are resource or system-level errors that may require administrator attention (insufficient memory, database full, configuration limits), and 20–25 are fatal errors that typically terminate the connection and may indicate hardware or database corruption.

This collection documents 15 SQL Server engine errors, covering constraint violations (2601, 2627, 547), deadlocks (1205), login failures (18456), permission errors (229), syntax errors (102, 207), and database-level issues (4060, 9002, 3201). Each entry explains the error meaning, its severity classification, and the database operation that typically triggers it.

Severity

Showing 15 of 15 error codes

1205
High

Deadlock — the transaction was deadlocked on resources with another process

3 common causes
9002
High

Transaction Log Full — the database transaction log is full and no writes are possible

3 common causes
3201
High

Cannot open backup device — SQL Server cannot access the specified backup file or path

3 common causes
2601
Medium

Duplicate Key — an attempt to insert a duplicate value into a unique index

3 common causes
2627
Medium

Constraint Violation — violation of a primary key or unique constraint

3 common causes
547
Medium

Conflicted Constraint — the statement conflicted with a foreign key or check constraint

3 common causes
18456
Medium

Login Failed — the user login attempt failed

3 common causes
208
Medium

Invalid Object — the specified object name is invalid or does not exist

3 common causes
4060
Medium

Cannot Open Database — the database requested by the login cannot be opened

3 common causes
229
Medium

Permission Denied — the current user lacks the required permission on the object

3 common causes
515
Medium

Cannot Insert NULL — a required column does not allow null values

3 common causes
8152
Medium

String or Binary Data Truncated — the value exceeds the column's defined length

3 common causes
1934
Medium

Update Conflict — the row was modified by another transaction after being read

3 common causes
102
Medium

Incorrect syntax near — a Transact-SQL syntax error was detected at the specified token

3 common causes
207
Medium

Invalid column name — referenced column does not exist in the table or result set

3 common causes

Frequently Asked Questions

Severity 0–10 are informational. Severity 11–16 are user-correctable errors (syntax, constraints, permissions). Severity 17–19 are resource or system errors requiring admin attention. Severity 20–25 are fatal errors that typically terminate the database connection.

Error 2601 indicates a duplicate key in a unique index — the index already contains the value being inserted. Error 2627 indicates a primary key or unique constraint violation — the constraint definition was violated. Both prevent the insert, but 2601 is index-specific while 2627 is constraint-specific.

Error 1205 means the transaction was selected as a deadlock victim and terminated to resolve a circular dependency between two transactions. SQL Server detects the deadlock and ends one transaction so the other can proceed.