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

Mukund M picture Mukund M · Oct 25, 2017 · Viewed 25.1k times · Source

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?

Answer

Mortimer452 picture Mortimer452 · Oct 25, 2017

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.