Look up any SQL Server error by number: the cause, examples, fixes and prevention.
Constraint & Integrity 5
2627
Violation of PRIMARY KEY / UNIQUE constraintCannot insert a duplicate key into a primary key or unique constraint.
2601
Cannot insert duplicate key row with unique indexA duplicate value broke a unique index (the index version of 2627).
547
Statement conflicted with a FOREIGN KEY or CHECK constraintAn insert, update or delete broke a foreign key or check rule.
515
Cannot insert the value NULL into a NOT NULL columnA required column was left NULL and has no default value.
1785
Introducing FOREIGN KEY may cause cycles or multiple cascade pathsA CASCADE foreign key would create more than one cascade path.
Login, Connection & Permissions 9
18456
Login failed for userAuthentication failed; the state number reveals the real reason.
4060
Cannot open database requested by the loginThe requested database is missing, offline or off-limits to the login.
4064
Cannot open user default databaseThe login default database cannot be opened, so the connection fails.
229
The permission was denied on the objectThe user lacks SELECT, EXECUTE or another object-level permission.
262
Permission denied, unable to run a statementThe user cannot run CREATE, ALTER or another statement-level command.
15247
User does not have permission to perform this actionA 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 itThe 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 nearThe parser hit an unexpected token in your T-SQL.
156
Incorrect syntax near the keywordA reserved keyword was used or placed where it is not allowed.
207
Invalid column nameThe query references a column that does not exist in scope.
208
Invalid object nameThe table, view or object cannot be resolved.
201
Procedure or function expects a parameter which was not suppliedA required stored procedure parameter was not passed.
3701
Cannot drop the object because it does not exist or no permissionA DROP failed on a missing object or without the right permission.
Data Type & Conversion 7
245
Conversion failed converting varchar value to intA text value could not be converted to a number.
8114
Error converting data type X to YA conversion failed, often through a stored procedure parameter.
8115
Arithmetic overflow converting expression to data typeA value was too large for the target numeric type.
8134
Divide by zero error encounteredAn expression divided by zero.
512
Subquery returned more than 1 valueA scalar subquery returned more than one row.
8152
String or binary data would be truncatedA 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
Resources 2
No errors match your search.