Fix “System.OutOfMemoryException” while importing csv to database
Fix “System.OutOfMemoryException” ONCE AND FOR ALL!
So if you’re like me, you do DB Admin stuff for fun…. Oh wait, you don’t count that as fun… well whatever… lol.
You’re here to resolve the System.OutOfMemoryException error thats preventing you from importing any usable amount of data into MSSQL via SSMS. You’ve likely been trying all manner of custom approaches… Be that be custom SQL scripting to insert a few thousand rows at a time… Maybe you’ve found some elegant scripting solution written in VB that claims to solve the time old issue….. I’d assume they didn’t work, as they didn’t work for me.
I can solve all your issues trying to use SSMS to import your data by simply saying…. STOP USING SSMS! Its really that simple. For this quick guide, we’ll be Using DBeaver.
DBeaver is an Open source database management tool that is actually a pleasure to use.
Step 1: Download and Install DBeaver
Step 2: Open DBeaver and Connect to your Database.
Step 3: Create your Schema as necessary.
Step 4: Import your data