views:

92

answers:

3

I got this error running a query that goes against 2 tables with combined 50k rows.

An error occurred while executing batch. 
Error message is: Insufficient memory to continue the execution of the program.

How do I get around this?

Edit

I get this when I run DBCC MEMORYSTATUS

Msg 2571, Level 14, State 1, Line 1
User 'XXXX\YYYY' does not have permission to run DBCC memorystatus.

New Edit

The server worked fine the next morning without reboots or anything else.

+1  A: 

Is it error 701, 801 or 802?

You need to investigate what is consuming the memory, see:

Remus Rusanu
A: 

What is the query? Did you accidentally do a cross join?

HLGEM
The query was EXISTS with a JOIN
Raj More
+1  A: 

Can you check what is the growth setting for temp db and for that particular Database?

Please ensure that the logfiles of temp db and that database are not set to restricted growth?

Can you check the available memory of the system while you are running the batch?

Manjot