Published: 2026-11-07
How to run a large SQL file without opening it
A database dump of a few hundred megabytes is too big for most SQL editors, because they read the whole file into memory before they show it. To run a file like that you use the database's command-line client, or, since Jam SQL Studio 1.5.9, Run SQL File, which runs a .sql file on a saved connection straight from disk. This post covers why editors refuse big files, the command-line way, and how to run one in Jam SQL Studio.
Why a SQL editor won't open a large dump
A query editor keeps the full text in memory and does more work on top of it: syntax highlighting, error checking and an undo history. A mysqldump or pg_dump --inserts file is mostly INSERT statements, each one a single long line holding thousands of rows. Open a few hundred megabytes of that and the editor either freezes for minutes or runs out of memory.
Jam SQL Studio's editor accepts files up to 50 MB and refuses larger ones before reading them. Until 1.5.9 the refusal told you to use the command-line client. Then a user restoring a MySQL dump asked whether the limit could be removed. The limit stays, because it keeps the editor from running out of memory. You rarely need to read a dump anyway, only to run it, so 1.5.9 added a way to run a file without opening it.
The command-line way
Every engine ships a client that runs a file without an editor:
mysql -h db-host -u app -p shop_restore < shop-2026-11-07.sql
psql -h db-host -U app -d shop_restore -f shop.sql
sqlcmd -S db-host -U app -d Shop -i shop.sql
sqlplus app@db-host/FREEPDB1 @shop.sql
sqlite3 shop.db ".read shop.sql"This works, but you need the client installed (a Mac has none of them by default), you type the host, login and password again even though your SQL tool already has them saved, and you see no progress until the client finishes. The mysql client also stops at the first error unless you pass --force.
Run SQL File in Jam SQL Studio
1. Open it
When you open a .sql file over 50 MB, the message that refuses it has a Run SQL File… button. You can also start from More → Run SQL File… in the toolbar or from the command palette.
2. Choose where it runs
The dialog shows the file, its size, and the connection and database it will run in, both taken from the active query tab. You can pick another connected connection or another database. Continue after errors is off, so by default the run stops at the first statement that fails.
3. Run it
Jam SQL Studio reads the file twice and never holds all of it in memory. The first pass counts the statements without running any of them; the second runs them one at a time on a connection opened for this run. The dialog shows the line in progress, how much of the file has run, and the statement, error and row counts. You can close the dialog and keep working: Keep running lets the run finish, and a message appears when it ends.
mysqldump file.The file in these screenshots is a 62 MB mysqldump of two tables. On a local MySQL 8.0 server it ran in 32 seconds: 669 statements and 1,294,000 rows.
4. Read the errors
With Continue after errors ticked, the run goes on past a failed statement and lists each failure with its line number, the server's message and the start of the statement. Copy puts the list on the clipboard.
Before you run a dump
- Each statement is committed as it runs. Statements that ran before an error or a Stop stay applied, so restore into an empty database that is easy to drop and start again.
- The file is one session. A
USE, aSETor a temporary table in the file carries on to the statements after it, and none of it changes your query tabs. - Statements are cut the way the database's own client cuts them:
DELIMITERblocks inmysqldumpfiles,GObatches on SQL Server, a/after a PL/SQL block on Oracle. UTF-16 files, which SQL Server Management Studio's Generate Scripts saves by default, run too. - One statement can be up to 64 MB (MySQL's default
max_allowed_packet). The file itself has no size limit. - Default
pg_dumpfiles are refused. They hold table data asCOPY … FROM stdinblocks, which onlypsqlcan feed to the server. The dialog names the line before anything runs. Create the dump withpg_dump --inserts, or run it withpsql.
pg_dump file with COPY data is refused before any statement runs.Run SQL File is in the desktop app for SQL Server, PostgreSQL, MySQL and MariaDB, Oracle and SQLite connections. The Query Editor docs cover the rest: Stop, lost connections, files that change during a run, and the full list of files that are refused.
Quick Answers
Q: How do I run a SQL file that is too large to open in an editor?
Run it from disk instead of opening it: with the database's command-line client (mysql, psql, sqlcmd, sqlplus or sqlite3), or in Jam SQL Studio 1.5.9 and later with More → Run SQL File…, which runs the file on a saved connection without loading it into the editor and shows progress and failed statements.
Q: Can Run SQL File run a pg_dump file?
Only a plain SQL one. By default pg_dump writes table data as COPY … FROM stdin blocks, which only psql can feed to the server, so Run SQL File refuses such a file before running anything and names the line. Create the dump with pg_dump --inserts, or run it with psql.
Q: What happens when a statement in the file fails?
By default the run stops at the first failed statement. With Continue after errors ticked it runs the rest of the file and lists every failure with its line number and the server's message. Each statement is committed as it runs, so the statements that ran before an error stay applied.
Jam SQL Studio 




