Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Processor error

Status
Not open for further replies.

Jules10010

IS-IT--Management
Joined
Feb 6, 2002
Messages
8
Location
GB
Hi,

I am using SQL 7 and I had the following error returned.

Internal Query Processor Error: The query processor encountered an unexpected error during execution.

Does anybody know what this error means and what caused it?

Thanks in advance.

 
Could you show us the sql statement that is causing this error?
 
It means what it said...something unexpected happened while it was trying to execute the script. It could have been an error in the script itself that the compiler didn't catch. It could have been an error caused when some value was returned (or not returned) unexpectedly.

Did you look in the SQL Server error logs to see if there were any additional errors?

-SQLBill
 
Thank you!

Unfortunately, I cannot find out which part of the code caused the error and there is no other messages in the SQL log.
 
Does this happen every time you run the code or only when certain input parameters are given?

I don't think SQL Server 7 has the stored procedure debugger does it?

I take it this is a somewhat complex stored procedure with multiple steps?

Here's what I would do to debug. First I would comment out all but the first line (line being flexible, what I really mean is the first complete SQL statment) of code and then run the procedure. If it didn't bomb, I would uncomment the next section of code and run the procedure. Keep doing this until you find the section it is bombing on.

Another thing I do when I have a complex procedure with a lot of different possible branches is to put a different select statement in each branch that is something like Select 1, Select 2, etc.

It will return all the select statements in query analyzer that were in branches executed and you can see right away whether it went to the branches you intended and if not where it went wrong. This will also give you a hint as to where it is hanging up if it gets in a processing loop because you can see which statements are being repeated or which was the last one executed.

Something else that can help in debugging complex stored procedures is print out the procedure and number each begin end statement pair. You will often find the source of your problem is that one of the pairs does not end where you thought it should.

I know none of this is specific to your problem, but it may give you some things to try.
 
The crashing is not consistent which is very strange, or thought logic was going on here some where :-)

Anyway, Thanks for your help I will give your points a try!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top