Mukund M
Mukund M

Reputation: 151

An error occurred while executing batch. Error message is: Exception of type 'System.OutOfMemoryException' was thrown."

I have one table(Sql server 2014) with 60 million data. while fetching the data i am getting

"An error occurred while executing batch. Error message is: Exception of type 'System.OutOfMemoryException' was thrown."

Can any one please help here?

Upvotes: 14

Views: 74187

Answers (7)

subash sapkota
subash sapkota

Reputation: 81

After I deleted the temp file then it worked. Delete the file permanently Ctrl + Shift + Delete

Upvotes: 0

Rodas PT
Rodas PT

Reputation: 339

In my case I was having problems even with tables with 8 rows. This worked for me:

  • Deleting Temp file present on %temp% location. If the problem still happens restart SSMS.

This happened due to unused temp files.

Upvotes: 0

Ravindranath K.
Ravindranath K.

Reputation: 41

Solution 1 : Close and re-opening SQL Server Management Studio and try querying.

Solution 2:

enter image description here

Upvotes: 2

Anil Sati
Anil Sati

Reputation: 11

If you have opened so many new query editors in the SSMS, that can also cause this error. Try closing unnecessary tabs in SSMS.

Upvotes: 1

Khati Lx
Khati Lx

Reputation: 39

This exception is caused by SSMS process which is occupied by long running queries.Don't worry about it , you can try next time and run your query on next tab.

Upvotes: 0

Enot
Enot

Reputation: 29

Looks like SQL Management Studio memory leaking for long running sessions. Restart of it helps to solve this issue

Upvotes: 1

Mortimer452
Mortimer452

Reputation: 251

Close and re-open SQL Management Studio and see if that takes care of it. Mine does this from time to time even on small queries if I leave it open for too long or have too many query windows open.

Upvotes: 24

Related Questions