存储过程结束了,messages中没有错误,但右下角说query completed with errors

javawhy 2009-09-25 03:33:27
When I execute a particular stored procedure in SQL Server 2005, the procedure completes and the results pane shows the number of records affected by the procedure. (The number of records affected indicate that the procedure completed successfully. Also, the correct number of records are inserted into a table.) However, the bottom of the query analyzer window says that the "query batch completed with errors." The result pane does not show any errors, only how many records were affected. Unfortunately, the procedure won't complete at all when it is called from a SQL Server job. The job reports failure, and the procedure does not insert all of the records into the table.

All the procedure does is select values into variables from various tables and then insert records into a table.

What might cause this? Is there a way to trap "soft" errors so I can see what is happening?

Your help is much appreciated.
...全文
588 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
javawhy 2009-09-25
  • 打赏
  • 举报
回复
不会设定maxerror number

根据大师的思想已经检查出部分脏数据,一会再看下情况
javawhy 2009-09-25
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 7761098 的回复:]
这种一般都是大批量数据处理时候的一些数据格式问题,设定maxerror number
然后分批处理,找出dirty data

[/Quote]


怎么设置啊,能否讲讲啊
7761098 2009-09-25
  • 打赏
  • 举报
回复
这种一般都是大批量数据处理时候的一些数据格式问题,设定maxerror number
然后分批处理,找出dirty data
javawhy 2009-09-25
  • 打赏
  • 举报
回复
网上一google发现,正好有个外国程序员也有这样错误,直接复制他的描述了.


我的情况是这样的.
我定义了一个游标,在下面的操作中修改了基表,第一次执行的时候是没有问题的,但再次执行的时候就出现 

代码跑完了,也出现影响的行.

但左下角出现 query complete with errors

MESSAGES中也没有错误提示

致命的是,接下来的存储过程语句就不执行了.

--小F-- 2009-09-25
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 dawugui 的回复:]
有请小P梁
[/Quote]

...
dawugui 2009-09-25
  • 打赏
  • 举报
回复
有请小P梁
SqlServer2008 2009-09-25
  • 打赏
  • 举报
回复
你是问问题还是考人啊
SqlServer2008 2009-09-25
  • 打赏
  • 举报
回复
晕 问问题还用e文
soft_wsx 2009-09-25
  • 打赏
  • 举报
回复
考验我!

22,296

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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