请教:请问SQL SERVER中SQLCODE=1 SQLSTATE=01000表示什么意思?

ChristmasEve 2007-03-27 10:58:21
请问SQL SERVER中SQLCODE=1 SQLSTATE=01000表示什么意思?
...全文
2489 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
lizhizhe2000 2007-03-27
  • 打赏
  • 举报
回复
学习!
feixiangVB 2007-03-27
  • 打赏
  • 举报
回复
記下了~~~~
CathySun118 2007-03-27
  • 打赏
  • 举报
回复
SQLSTATE=01000 常规警告
dawugui 2007-03-27
  • 打赏
  • 举报
回复
SQLCODE Variable
The most important and widely used field of the SQLCA data structure is the SQLCODE variable. Each time Microsoft® SQL Server™ 2000 runs an Embedded SQL statement, it sets the value of the SQLCODE variable to indicate whether the last Embedded SQL statement completed successfully. A value of 0 indicates that the last Embedded SQL statement was successful. Values other than 0 indicate warnings or errors.

To use SQLCODE in your program, you can either declare it explicitly as long SQLCODE; or leave it undeclared and have the precompiler generate a declaration. However, the precompiler only generates a declaration in a source module that contains a main() or a WinMain() function.

The preprocessor automatically inserts the following definition in all .sqc modules, so the actual definition of SQLCODE should only occur in one module.

extern long SQLCODE;

If your project does not include a .sqc file that includes a main() or WinMain() function, you must explicitly declare SQLCODE in one of your modules. Explicit SQLCODE declarations can occur either inside or outside of a host variable declaration block.

dawugui 2007-03-27
  • 打赏
  • 举报
回复
SQLCODE

连接数据库后是否有数据返回.为1是正确且有数据返回.
dawugui 2007-03-27
  • 打赏
  • 举报
回复
SQLSTATE ODBC API(驱动程序管理器)错误
00000 成功
01000 常规警告
01002 断开连接错误
01004 数据被截断
01006 未废除特权
01S00 无效连接字符串特性
01S01 行中的错误
01S02 选项值已更改
01S03 未更新或删除任何行
01S04 更新或删除了多行
01S05 取消操作被当成 FreeStmt/Close
01S06 设法在结果返回第一个行集之前进行提取
07001 参数个数错误
07006 违反受限制的数据类型特性
07S01 默认参数使用无效
08001 无法连接到数据源
08002 连接正在使用
08003 连接未打开
08004 数据源拒绝建立连接
08007 在执行事务的过程中连接失败
08S01 通讯链接失败
21S01 插入值列表与列列表不匹配
21S02 派生表的程度与列列表不匹配
22001 字符串数据右截断
22002 需要指示符变量,但未提供
22003 数字值超出范围
22005 分配时出错
22008 Datetime 字段溢出
22012 被零除错误
22026 字符串数据,长度不匹配
23000 违反完整性约束
24000* 无效的游标状态
25000 无效的事务状态
28000 无效的授权规范
34000 无效的游标名称
37000 语法错误或违规访问
3C000 重复的游标名称
40001 串行错误
42000 语法错误或违规访问
70100 操作终止
IM001 驱动程序不支持本函数
IM002 未找到源名称并且未指定默认驱动程序
IM003 无法装载指定的驱动程序
.................

查帮助
ChristmasEve 2007-03-27
  • 打赏
  • 举报
回复
多谢

27,579

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 应用实例
社区管理员
  • 应用实例社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧