Raj More
Raj More

Reputation: 48016

SQL Server out of memory

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.

Upvotes: 1

Views: 2815

Answers (3)

Manjot
Manjot

Reputation: 11516

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?

Upvotes: 1

HLGEM
HLGEM

Reputation: 96552

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

Upvotes: 0

Remus Rusanu
Remus Rusanu

Reputation: 294227

Is it error 701, 801 or 802?

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

Upvotes: 1

Related Questions