How to open a huge .sql file

EmEditor is the best solution for you.

I faced a similar situation where I had to edit a 3GB .sql file. After long researches and multiple "Not Responding" windows, EmEditor did the job.

Tried many editors nothing worked, all crashed or hung(on windows).

For a one time or for short duration you could use a trial version. For a longer/permanent usage you will have to buy the premium.

Below is the download link.

https://www.emeditor.com/#download


Firstly you do something wrong. Describe how and why you got a 2.7GB file. Most likely there is an alternative solution to your problem.

You can execute a file of this size with command line utility sqlcmd.exe. MSDN sqlcmd utility

sqlcmd.exe -S servername -U login -P password -d databasename -i BigBigFile.sql -o out.txt

But it will be very very very slowly as insert will be one by one row

Also I do not see any reason to open such a large file in the editor. But if you want - I opened the file >3Gb the internal editor of file manager FarManager3.0 x64 (my config Win7 x64, 8Gb ram, i7-3770). And it was also quite slow

Perhaps we should look for other options for data transfer:

MSDN Bulk import/export

MSDB SQL Server Import and Export Wizard

MSDN BACKUP and RESTORE


I had the same problem today with mega-gigabyte sql files so wrote a command line utility to separate them into smaller files to process.

splitfile.exe -file "largefile.sql" -batch 5000

http://www.esensible.com/our-products/utilities/splitfile-split-large-text-files/

Source code is there as well (Visual Studio 2015)


Try to open the file in the browser and then copy the needed lines in the editor. That worked for me.

Tags:

Sql Server