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.

解决方案 »

  1.   

    网上一google发现,正好有个外国程序员也有这样错误,直接复制他的描述了.
    我的情况是这样的.
    我定义了一个游标,在下面的操作中修改了基表,第一次执行的时候是没有问题的,但再次执行的时候就出现 代码跑完了,也出现影响的行.但左下角出现 query complete with errorsMESSAGES中也没有错误提示致命的是,接下来的存储过程语句就不执行了.
      

  2.   

    这种一般都是大批量数据处理时候的一些数据格式问题,设定maxerror number
    然后分批处理,找出dirty data
      

  3.   

    不会设定maxerror number 根据大师的思想已经检查出部分脏数据,一会再看下情况