Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 521
Mukund M Avatar asked Oct 25 '17 11:10

Mukund M


People also ask

How do you fix system OutOfMemoryException exception of type system OutOfMemoryException was thrown?

OutOfMemoryException Exception of type 'System. OutOfMemoryException' was thrown. To resolve this issue, I had to restart Visual Studio or go to the Windows Task Manager and terminate IIS Express process. This error could happen due to a variety of reasons related to memory consumption of the application.

How does SQL Server handle out of memory exception?

Use sqlcmd Utility instead of SSMS to run the SQL queries. This method enables queries to be run without the resources that are required by the SSMS UI. Additionally, you can use the 64-bit version of Sqlcmd.exe to avoid the memory restriction that affects the 32-bit SSMS process.

What is system out of memory exception?

OutOfMemoryException Class (System) The exception that is thrown when there is not enough memory to continue the execution of a program.


1 Answers

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.

like image 126
Mortimer452 Avatar answered Oct 05 '22 08:10

Mortimer452