Every now and then, I'll get the following message on my screen when running something large in SSMS: An error occurred while executing batch. Error message is: Exception of type 'System.OutOfMemoryException' was thrown.
The issue is, that once this error gets thrown, there seems to be no respite other than a reboot of the machine. I understand that this is an issue with memory on my machine and that this doesn't affect the server at all; however, rebooting in the middle of the day for a dev is never pleasant.
Any help would be greatly appreciated!
Since I came up with the original "Comment" answer... Here it is.
Closing SSMS should terminate the transaction and free up memory.
Glad this worked out for you.