Codewith
SQL
.com
Home
Courses
Blog
Resources
Interview Questions
SQL Exercises
SQL Functions
SQL Server Errors
SQL Tools
SQL Comparisons
About
Contact
Mentorship
SQL Server Error Library
Look up any SQL Server error by number: the cause, examples, fixes and prevention.
All
Constraint & Integrity
Login, Connection & Permissions
Syntax & Object Resolution
Data Type & Conversion
Concurrency & Locking
Resources
Constraint & Integrity
5
2627
Violation of PRIMARY KEY / UNIQUE constraint
Cannot insert a duplicate key into a primary key or unique constraint.
2601
Cannot insert duplicate key row with unique index
A duplicate value broke a unique index (the index version of 2627).
547
Statement conflicted with a FOREIGN KEY or CHECK constraint
An insert, update or delete broke a foreign key or check rule.
515
Cannot insert the value NULL into a NOT NULL column
A required column was left NULL and has no default value.
1785
Introducing FOREIGN KEY may cause cycles or multiple cascade paths
A CASCADE foreign key would create more than one cascade path.
Login, Connection & Permissions
9
18456
Login failed for user
Authentication failed; the state number reveals the real reason.
4060
Cannot open database requested by the login
The requested database is missing, offline or off-limits to the login.
4064
Cannot open user default database
The login default database cannot be opened, so the connection fails.
229
The permission was denied on the object
The user lacks SELECT, EXECUTE or another object-level permission.
262
Permission denied, unable to run a statement
The user cannot run CREATE, ALTER or another statement-level command.
15247
User does not have permission to perform this action
A server-level or administrative action needs a higher permission.
53
A network-related or instance-specific error (server not found)
The client could not reach a listening SQL Server instance.
10061
TCP Provider: target machine actively refused it
The host was reached but nothing was listening on that port.
40615
Cannot open server requested by the login (Azure firewall)
Azure SQL blocked the client IP address at the firewall.
Syntax & Object Resolution
6
102
Incorrect syntax near
The parser hit an unexpected token in your T-SQL.
156
Incorrect syntax near the keyword
A reserved keyword was used or placed where it is not allowed.
207
Invalid column name
The query references a column that does not exist in scope.
208
Invalid object name
The table, view or object cannot be resolved.
201
Procedure or function expects a parameter which was not supplied
A required stored procedure parameter was not passed.
3701
Cannot drop the object because it does not exist or no permission
A DROP failed on a missing object or without the right permission.
Data Type & Conversion
7
245
Conversion failed converting varchar value to int
A text value could not be converted to a number.
8114
Error converting data type X to Y
A conversion failed, often through a stored procedure parameter.
8115
Arithmetic overflow converting expression to data type
A value was too large for the target numeric type.
8134
Divide by zero error encountered
An expression divided by zero.
512
Subquery returned more than 1 value
A scalar subquery returned more than one row.
8152
String or binary data would be truncated
A value was too long for the column (the classic, unnamed message).
2628
String or binary data would be truncated (named column)
The 2019+ message that names the table, column and truncated value.
Concurrency & Locking
2
1205
Transaction was deadlocked and chosen as the victim
Two transactions blocked each other; one was killed to break the cycle.
1222
Lock request time out period exceeded
A statement waited too long for a lock and gave up.
Resources
2
9002
The transaction log for database is full
The log file cannot grow or reuse space, so writes stop.
1105
Could not allocate space because the filegroup is full
A data file or filegroup ran out of room for new pages.
No errors match your search.