|
SQLSTATE代码和消息
|
|
警告
|
需要用户用户注意但尚未严重妨碍SQL语句成功执行的情况
|
例外
|
使用SQL语句无法对数据库产生影响的情况
|
|
SQLSTATE代码存储在sysmessages系统表中
|
|
|
|
消息
|
中文解释
|
发生条件
|
警告
|
|
|
Warning-null value eliminated in set funcation
|
警告-set函数中的NULL值已经消除
|
对具有NULL值的表达式使用集合函数(avg/max/min/sum/count)时会出现此信息
|
Warning-string data,right truncation
|
警告-字符串数据,右截断
|
将字符,unichar或二进制数据截断为255字节时会出现此信息.
|
|
|
|
基数冲突
|
|
|
Subquery returned more than 1value.this is illegal when the subquery follow =,!=,<,<=,>=,or when the subquery is user as an expression
|
子查询返还不止一个值,当子查询跟在=,!=,<之后或者当子查询用作表达式时,这种情况是非法的
|
标量子查询或行子查询返回不止一行
|
|
|
|
数据例外
|
|
|
Arithmetic overflow occurred
|
发生算术溢出
|
算术运算或SUM函数,以及截断,舍入使精确数值类型丢失精度或标度
|
Data exception-string data right truncated
|
数据例外-字符串从右侧被截断
|
列太短,不能容纳插入或更新的数据,而必须截断非空字符.
|
Divide by zero occurred
|
发生零除错误
|
对数字表达式求值而除数的值为零
|
Illegal escape character found.There are fewer bytes than necessary to form a valid character
|
发现非法的转义字符,形成有效字符所需的字节数不过.
|
在转义序列不是由单个字符构成时,搜索与给定模式相匹配的字符串.
|
Invalid pattern string.The character following the escape character must be percent sign ,underscore ,left square bracket, right square bracket, or the escape character.
|
无效的模式字符串.转义字符后的字符必须是百分号,下划线,左方括号,右方括号或转义字符
|
搜索与特定模式相匹配的字符串时.
|
|
|
|
完整性约束冲突
|
Insert,update或delete语句与primary key ,foreign key .check或unique约束或唯一索引发生冲突.
|
Attempt to insert duplicate key row in object_name with unique index index_name
|
试图在具有唯一索引index_name的对象object_name中插入重复的键行
|
在具有唯一约束或索引的表中插入重复的行.
|
Check constraint violation occurred ,daname=database_name,table name=table_name,constraint name=constraint_name.
|
发生检查约束冲突
|
Update或delete与列的检查约束发生冲突.
|
Dependent foreign key constraint violation in a referential integrity constraint
|
参照完整性约束中发生相关外键约束冲突.
|
主键表上的update或delete与外键约束发生冲突.
|
Foreign key constraint violation occurred,
|
发生外键约束冲突
|
在主键表中无匹配值的情况下对外键表执行insert或update
|
|
|
|
无效的游标状态
|
|
|
Attempt to use cursor cursor_name which is not open.Use the system stored procedure sp_cursorinfo for more information.
|
试图使用未打开的游标cursor_name.有关详细信息,请使用系统存储过程sp_cursorinfo
|
试图从未打开或已被commit语句或者隐式(或显式)rollback关闭的游标中进行读取.重新打开游标并重新执行fetch
|
Cursor cursor_name was closed implicitly because the current cursor position was deleted due to an update or a delete.The cursor scan position could not be recovered.This happens for cursors which reference more than one table.
|
由于当前游标位置因执行update 或delete而被删除,因此游标cursor_name被隐式关闭.
|
多表游标的连接已被删除或更改.发出另一个fetch以重新定位游标.
|
|
|
|
语法错误和访问规则冲突
|
|
|
Command permission denied on object object_name,database database_name,owner owner_name
|
对象object_name,数据库database_name,所有者owner_name上的command权限被拒绝.
|
用户试图访问他们没有正确权限的对象.
|
Implicit conversion from datatype ‘datatype’ to ‘datatype’ is not allowed.Use the convert function to run this query.
|
不允许执行从数据类型‘datatype’到‘datatype’的隐式转换.请使用convert函数来运行该查询.
|
用户试图将一种数据类型转换为另一种数据类型.
|
Incorrect syntax near object_name
|
object_name附件有语法错误
|
在指定对象附近发现错误的SQL语法.
|
Insert error:column name or number of supplied values does not match table definition
|
插入错误:列名或所提供值的数量与表定义不匹配.
|
插入时使用了无法的列名或插入的值的个数不正确.
|
Missing end comment mark’*/’
|
缺少结束注释符’*/’
|
有/*开始的注释
|
Object_name not found.Specify owner.objectname or use sp_help to check whether the object exists .
|
未找到Object_name,指定owner.objectname或使用sp_help检查对象是否存在.
|
用户试图引用他们不具有权限的对象.
|
The size given to the object_name exceeds the maximum.The largest size allowed is size.
|
为object_name指定的大小超出最大值.允许最大值为size
|
表定义中所有列的大小总和超出行大小允许的最大允许值.
|
Your server command was deadlocked with another process and has been chosen as deadlock victim
|
你的服务器命令与另一进程发生死锁并且被选作死锁的牺牲品.
|
检测到它无法保证两个或两个以上的并发事务可以序列化.
|
|
|
|
With check option
|
|
|
The attempted insert or update failed because the target view was either created with check option or spans another view created with check iption.
|
插入或更新尝试失败,原因是目标视图使用With check option创建的或者跨越了另一个用With check option创建的视图
|
视图或视图所依赖的任何视图是用With check option子句创建的.
|
相关推荐
常见的SQLSTATE代码如42S02表示未知表,42S22表示无效的列名等。 - **按Sybase错误代码进行索引**:这部分则根据Sybase特有的错误代码进行分类,涵盖了更多具体的错误情况,如与服务器连接问题、权限问题、表空间...
SQLSTATE是一种错误代码标准,用于描述SQL语句执行时发生的错误类型。例如: - `01000`: 一般警告 - `02000`: 没有数据,这是正常的预期情况 - `42000`: SQL语法或相关错误 #### 三、Transact-SQL常用命令 ##### 1...
SYBASE和AS/400 DB2在数据类型的表示上存在一些差异,这需要我们在迁移过程中进行适当的转换。 - **Datetime vs Timestamp**: SYBASE中的`Datetime`类型在DB2中对应为`Timestamp`。 - **Tinyint, Smallint**: 这些...
此外,SYBASE SQL Server 提供了特定的语法和特性,比如用于错误处理的`WHENEVER`命令。 **2.2 嵌入SQL的处理过程** 1. **预编译**:预编译器处理源代码,将SQL语句转换成函数调用形式。 2. **编译**:C编译器编译...
- **SQLSTATE 错误**:错误代码和含义。 #### 三、命令 **1. 数据定义语言 (DDL)** - **CREATE TABLE**:用于创建新表。 - **ALTER TABLE**:修改现有表的结构。 - **DROP TABLE**:删除表。 - **CREATE INDEX**:...
与Sybase和Oracle等数据库相比,DB2在临时表的处理上有所差异。 - **使用场景**:在多线程或多用户环境中,临时表可以用来存储临时结果集或中间计算结果。 - **注意事项**: - 会话级临时表只对当前会话有效,一旦...