Link to home
Start Free TrialLog in
Avatar of dbaGrant
dbaGrantFlag for United States of America

asked on

"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.
Avatar of DonKronos
DonKronos
Flag of United States of America image

In QA click on the Messages tab (right next to the Results tab).  It will show the errors.
Avatar of dbaGrant

ASKER

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.
Avatar of imran_fast
imran_fast

>>then insert records into a table.
Does those tables have any triggers on them?
ASKER CERTIFIED SOLUTION
Avatar of Racim BOUDJAKDJI
Racim BOUDJAKDJI
Flag of Algeria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial