Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 A severe error occurred on the current command. T

Author  Topic 

Tjaard
Starting Member

11 Posts

Posted - 2008-08-27 : 11:05:11
Hia guys, hope all is well.

I've run into this problem only once, and sadly that was on a major client's server.(Only difference between tested servers and failure one is that it fails on 64 bit machine, but not sure if that's the issue.)

Basically I'm running a huge Stored Procedure that places data into about 15 temp tables before binding it all together into a single result set.

My problem is it seems that SQL runs out of memory or something halfway through the proc and I get the infamous :
"Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded."
error.

I'm using alot of temp tables, but there's only a total of about 20 records in them when the error occurs.

This error even occurs when I'm not using the stored proc, but rather running the script directly.

If anyone has any ideas I would truly appreciate your input.

Thanks, Tjaard

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-27 : 13:13:19
Why should you be using this much temp tables? can you give a background of what you're trying to do? perhaps somebody might be able to provide a much easier method
Go to Top of Page

Tjaard
Starting Member

11 Posts

Posted - 2008-08-28 : 03:24:02
Hi Visakh, I'm afraid I have no choice but to use the temp tables I'm using. I believe the error occurs because SQL runs out of cache memory for the stored procedure, might be mistaken. That said, I get the same error when attempting to run the script directly, without making use of a stored procedure.

To give you some background on the situation, I need to retrieve documents from a multitude of tables. do calculations on them and then match them up (group them together) with Invoices. i.e. Invoices, Credit Notes, Payments, reconcilliations, Journal ertires etc are retrieved, the final result needs to show which document movements took place relevant to a specific Invoice.

The temp tables are required because of the calculations that needs to done on the documents.

Now, the querie runs 100% on all but one server I've tested on. (4 out of 5)

Any ideas?
Go to Top of Page
   

- Advertisement -