Wednesday, July 21, 2010

SQL Server Error Codes

 

The following table lists the SQL error codes. These codes are returned as the SQLCODE variable. 


SQL Error Codes

SQLCODE Error Code Meaning
-11002 WinSock: Nonauthoritative host not found
-11001 WinSock: Host not found
-10093 WinSock: Successful WSASTARTUP not yet performed
-10092 WinSock: WINSOCK DLL version out of range
-10091 WinSock: Network subsystem is unavailable
-10070 WinSock: Stale NFS file handle
-10065 WinSock: No route to host
-10064 WinSock: Host is down
-10061 WinSock: Connection refused
-10060 WinSock: Connection timed out
-10058 WinSock: Cannot send after socket shutdown
-10057 WinSock: Socket is not connected
-10056 WinSock: Socket is already connected
-10055 WinSock: No buffer space available
-10054 WinSock: Connection reset by peer (due to timeout or reboot)
-10052 WinSock: Net dropped connection or reset
-10051 WinSock: Network is unreachable
-10050 WinSock: Network is down
-500 Fetch row count limit reached
-471 Duplicate cursor name
-470 Option value changed
-469 Driver not capable
-468 Fetch type out of range
-467 Column type out of range
-466 Invalid parameter number
-465 Invalid string or buffer length
-464 Function sequence error
-463 Invalid column number
-462 Memory allocation failure
-461 Communication link failure
-460 General error
-453 Error in User Initialization Code
-452 Message sequencing error
-451 Unable to receive server message
-450 Unable to send client message
-430 Cannot initialize procedure context
-429 Invalid number of input/output parameters for Stored Procedure
-428 Stored Procedure Not Found
-427 Invalid Stored Procedure Name
-426 Error preparing Stored Procedure
-425 Error processing Stored Procedure request
-422 SELECT request processed via ODBC, JDBC, or Dynamic SQL cannot contain an INTO clause
-421 Warning: UPDATE or DELETE statement does not contain a WHERE clause
-415 Fatal error occurred within the SQL filer
-411 No stream object defined for field
-410 Invalid Directory
-409 Invalid server function
-408 Unable to start server
-407 Unable to Write to Server Master
-406 Unable to Write to Server
-405 Unable to read from communication device
-402 Invalid Username/Password
-401 Fatal Connection error
-400 Fatal error occurred
-374 Cannot alter the datatype of a field to/from a stream type when the table contains data
-373 An extrinsic function call may not call a % routine
-372 Support for extrinsic function calls are disabled
-371 :HVar = CALL ... Specified for a Procedure which does not return a value
-370 Embedded SQL CALL Statement can only be used for Method Procedures
-366 Schema name mismatch between trigger name and table name
-365 Trigger name not unique
-364 Trigger with same EVENT, TIME, and ORDER already defined
-363 Trigger not found
-362 Specified query or stored procedure not found
-361 More than one query or stored procedure found that matches your specification
-359 SQL Function (function Stored Procedure) not found
-358 SQL Function (function Stored Procedure) name not unique
-333 No such index defined
-325 Index cannot be dropped because it is the IDKEY index and the table has data
-324 Index with this name already defined for this table
-320 Cannot DROP table — One or more Foreign Key constraints reference this table
-319 Referenced table has no primary key defined
-317 Cannot DROP Constraint — One or more Foreign Key constraints reference this Unique constraint
-315 Constraint or Key not found
-314 Foreign key references non-unique key/column collection
-311 Foreign key with same name already defined for this table
-310 Foreign key references non-existent table
-307 Primary key already defined for this table
-306 Column with this name already exists
-305 Attempt to make field required when the table has one or more rows where the column value is NULL
-304 Attempt to add a NOT NULL field with no default value to a table which contains data
-300 DDL not allowed on this table definition
-201 Table or View name not unique
-137 View's WITH CHECK OPTION validation failed in UPDATE
-136 View's WITH CHECK OPTION validation failed in INSERT
-135 After Delete trigger failed
-134 Before Delete trigger failed
-133 After Update trigger failed
-132 Before Update trigger failed
-131 Before Insert trigger failed
-130 Before Insert trigger failed
-127 FOREIGN KEY Constraint failed referential check upon creation of the constraint
-125 UNIQUE or PRIMARY KEY Constraint failed uniqueness check upon creation of the constraint
-124 FOREIGN KEY Constraint failed referential check upon DELETE of row in referenced table
-123 FOREIGN KEY Constraint failed referential check upon UPDATE of row in referenced table
-122 FOREIGN KEY Constraint failed referential check upon UPDATE of row in referencing table
-121 FOREIGN KEY Constraint failed referential check upon INSERT of row in referencing table
-120 UNIQUE or PRIMARY KEY Constraint failed uniqueness check upon UPDATE
-119 UNIQUE or PRIMARY KEY Constraint failed uniqueness check upon INSERT
-118 Unknown or non-unique User or Role
-115 Cannot INSERT/UPDATE/DELETE on a read only table
-114 One or more matching rows is locked by another user
-113 %THRESHOLD Violation
-112 Access violation
-111 Cannot INSERT into a 'Default Only' RowID or RowID based on field
-110 Locking conflict in filing
-109 Cannot find the row designated for UPDATE
-108 Required field missing; INSERT or UPDATE not allowed
-107 Cannot UPDATE RowID or RowID based on Fields
-106 Row to DELETE not found
-105 Field validation failed in UPDATE
-104 Field validation failed in INSERT
-103 Positioned UPDATE or DELETE attempted, but the cursor is not positioned on any row
-102 Operation (FETCH/CLOSE/UPDATE/DELETE/...) attempted on an unopened cursor
-101 Attempt to open a cursor that is already open
-99 Privilege Violation
-97 Duplicate select-list names found
-96 Specified level of isolation is not supported
-95 Operation Disallowed by Operation Table
-94 Multi-Conditional OUTER JOINs are not supported
-93 Number of conditions for the DIAGNOSTICS SIZE must be exact numeric
-92 Level of isolation cannot be READ UNCOMMITTED if READ WRITE specified
-91 Transaction mode cannot be specified more than once
-90 Invalid view name
-89 Invalid index name
-88 Invalid field name
-87 Invalid table name
-86 Invalid field definition, no datatype defined
-85 Multiple table %ROUTINE definitions found
-84 Multiple table %NUMROWS definitions found
-83 Multiple table %FILE definitions found
-82 Multiple table %DESCRIPTION definitions found
-81 Column Constraint expected
-80 Integer expected
-79 Referencing key and referenced key must be the same size
-78 Invalid transaction state
-77 Qualified column reference not allowed in this JOIN context
-76 Cardinality mismatch between the SELECT-list and INTO-list
-75 Trim spec and/or trim char required before FROM in TRIM function
-74 Duplicate select-list alias names found
-73 Aggregates not supported in ORDER BY clause
-72 Multi-Line Field not valid in ORDER BY clause
-71 Multi-Line Field must be the Left operand of the Comparison
-70 Multi-Line Field only valid for LIKE, Contains ([), or NULL Comparison
-69 SET file = value-expression not allowed with WHERE CURRENT OF cursor
-68 DISTINCT not valid in subquery of FROM clause
-67 Aggregate not valid in subquery of FROM clause
-66 Redundant Fields Found in SELECT list
-65 Positive integer constant or variable expected
-64 Incompatible SELECT list is used in INSERT
-63 Data Exception - invalid escape character
-62 Additional new values expected for INSERT/UPDATE
-61 Cursor not updateable
-60 An action (%ALTER, SELECT, UPDATE, etc.) expected
-59 Cannot have more than one field
-58 Duplicate field found in trigger UPDATE of <fieldlist> clause
-57 Trigger specifies WHEN clause when trigger language not SQL
-56 Action not applicable to an object of this type
-55 Invalid GRANT role TO or REVOKE role FROM
-54 Array designator (last subscript omitted) expected after VALUES
-53 Constant or variable expected as new value
-52 Cursor (Already/Was Not) DECLAREd
-51 SQL statement expected
-50 Trigger specifies UPDATE OF <fieldlist> clause when trigger language not SQL
-49 Trigger REFERENCING clause cannot be specified when trigger language not SQL
-48 Invalid trigger REFERENCING clause for the trigger's event
-47 Illegal characteristic keyword for this type of create operation
-46 Missing EXECUTE or FETCH
-45 Duplicate query methods within the same statement
-44 Duplicate characteristics when creating a query, method, or procedure
-42 Closing quotes ("") missing following pattern match
-41 An extrinsic function call must have the form '$$tag^routine(...)'
-39 No RowID field for table
-38 No master map for table
-37 SQL Scalar/Aggregate/Unary function not supported for Stream fields
-36 WITH CHECK OPTION (CHECKOPTION class parameter) not allowed for a non-updatable view
-35 INSERT/UPDATE/DELETE not allowed for non-updatable view
-34 %INORDER: FROM order inconsistent with outer join order
-33 No field(s) found for table
-32 Outer-join symbol ( =* or *= ) must be between two fields
-31 Field not (Found/Mapped/Unique) in Table(s)
-30 Table or View not found
-29 Field ambiguous/not found
-28 Host variable name must begin with either % or a letter
-27 Ambiguous labels for field
-26 Missing FROM clause
-25 Input encountered after end of query
-24 Table or View not found
-23 Label is not listed in FROM
-22 ORDER must specify column names, not numbers, when after 'SELECT *'
-20 Name conflict in the FROM list over label
-19 An aggregate function cannot be used in a WHERE clause
-18 IS (or IS NOT) NULL predicate can be applied only to a field
-17 A for-condition expected after the ( in the for-expression
-16 A qualifier SOME or ALL expected after the FOR in the for-expression
-15 A condition expected after NOT
-14 A comparison operator is required here
-13 An expression other than a subquery expected here
-12 A term expected, beginning with one of the following: identifier, constant, aggregate, $$, :, (, +, -, %ALPHAUP, %UPPER, %STRING, or %EXACT
-11 A scalar expression expected, not a condition
-10 The SELECT list of the subquery must have exactly one item
-9 Incompatible SELECT lists used in UNION
-8 Invalid DATEPART code for DATEPART(), DATENAME(), DATEADD(), or DATEDIFF()
-7 ORDER column is not in the SELECT list
-6 ORDER must specify column number, not names, when after UNION
-5 Column number specified in ORDER does not match SELECT list
-4 A term expected, beginning with one of the following: identifier, constant, aggregate, %ALPHAUP, %UPPER, %STRING, %EXACT, $$, :, +, -, (, NOT, EXISTS, or FOR
-3 Closing quote (") missing
-2 Exponent digits missing after 'E'
-1 Invalid SQL statement
0 Successful Completion
100 No (more) data

No comments:

Post a Comment

Popular Posts