"Query completed with errors." - but there are no errors...

When I execute a particular stored procedure in SQL Server 2000 Query Analyzer, 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.
Who is Participating?
Racim BOUDJAKDJIDatabase Architect - Dba - Data ScientistCommented:
Run a Profiler Trace taking all the "Error and Warnings" section as it may give you more precise indication to the nature of the error (last statement executed before the error warning)...Hope this helps...
In QA click on the Messages tab (right next to the Results tab).  It will show the errors.
dbaGrantAuthor Commented:
No, there are no errors listed on the messages tab.  All the messages tab shows is the number of rows affected.  That is what is confusing.  Usually, if there is an error, you see it.  The only indication that there is an error here is that the status bar says "Query batch completed with errors."
You can test @@ERROR after each SQL statement to determine which statements are giving you errors.
>>then insert records into a table.
Does those tables have any triggers on them?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.