On this page

Import / Export

BroadSQL moves data in two directions. DUMP writes data out: a table, a query result, the result of a Script or of an API call, into a file, a spreadsheet or a local H2 database. LOAD reads data in: the rows of a CSV file, inserted into an existing table after a preview.

Why export from BroadSQL

The data you need is usually already on screen: you ran a query, looked at the result, and now someone needs it in Excel, in a ticket, in a wiki page, or you want to keep a copy to work on without querying a remote system again. DUMP turns that result into a file in one command, with the same syntax for every destination, so there is no copy and paste through another tool and no second query to write.

Choosing a destination

Choose the right command to get data out Where should the result go? On screen: run the query. To paste somewhere: COPY RESULT. To a file: DUMP AS CSV, TEXT, JSON, MD or HTML. To a spreadsheet tab: DUMP AS XLSX or ODS, with MODE APPEND to add rows. To a local database to work on: DUMP AS H2, with MODE MERGE KEY or APPEND KEY to keep it current. Read live, without copying: LINK TABLE, when the current connection is H2. Where should the result go? On screenSELECT ...; To paste somewhereCOPY RESULT; A file for a systemDUMP / TO f AS CSV; A spreadsheet tabDUMP / TO f.TAB AS XLSX; A local copy to work onDUMP t TO W.t AS H2; Read live, no copyLINK TABLE ...; rows beyond MaxRowsOnScreen are not shown also TEXT, JSON, MD, HTML MODE APPEND adds rows below MODE MERGE KEY keeps it current the current connection must be H2
DUMP: from any source to any destination Five sources on the left: a table, a query in parentheses, slash for the result on screen, a Script with LIB or at, and API RESULT. Three kinds of destination on the right: a file in CSV, TEXT, JSON, Markdown or HTML, which is replaced; a worksheet of an XLSX or ODS file, replaced or appended to; a table of a local H2 database, replaced, appended to, appended by key or merged by key. APPEND KEY needs a table or a query as its source. Source Destination and modes COUNTRYa table (SELECT ...)a query /the result on screen LIB s.sql or @s.sqla Script API RESULTthe last RUN DUMP A file: CSV TEXT JSON MD HTML replaced at each export A worksheet: XLSX ODS OVERWRITE (default) or APPEND A local H2 table: H2 OVERWRITE, APPEND, MERGE KEY APPEND KEY: table or query source One syntax: DUMP <source> TO <destination> AS <format> [MODE <mode>]
You wantUsePage
A file for a person or a tool: CSV, tab separated text, JSON, Markdown, HTMLAS CSV, AS TEXT, AS JSON, AS MD, AS HTMLFiles and spreadsheets
A workbook, built up one worksheet at a timeAS XLSX, AS ODSFiles and spreadsheets
A local copy you can query, refresh and keep longer than the sourceAS H2Local H2 datasets
The result of a Script, with its argumentsDUMP LIB, DUMP @Script and API results
The result of an API callDUMP API RESULTScript and API results
Rows of a CSV file, inserted into a tableLOADImporting data

The common syntax, the sources, the default file names and formats, date and time handling, and the commands kept from earlier releases are described in Exporting data.

A first export

Run a query, check the result, then export exactly what you saw:

SELECT CODE, TRIM(NAME) AS NAME FROM COUNTRY WHERE REGION = 'Baltic Countries' ORDER BY CODE;
DUMP / TO baltic AS MD;

BroadSQL prints:

BroadSQL session: after each prompt, what you type; the other lines are what BroadSQL prints
WORLD> DUMP / TO baltic AS MD;
3 row(s) exported to c:\temp\baltic.md.
Completed: 2026-10-18 10:02:11 +02:00 (0:00:00).
Illustrative output: the values come from the WORLD sample database and the layout from this release; it was not captured from a BroadSQL run, and your timings will differ.

baltic.md is a table ready to paste into an issue or a wiki page:

| CODE | NAME |
| --- | --- |
| EST | Estonia |
| LTU | Lithuania |
| LVA | Latvia |

The file is written to the export folder (DefaultFolder, see Application settings).

A first import

Preview a CSV file against an existing table, then insert it:

LOAD MY_VISIT my_visits.csv PREVIEW;
LOAD MY_VISIT my_visits.csv EXECUTE;

MY_VISIT is the practice table of Load a CSV file with a preview. The preview shows the target, the column mapping and the valid and rejected rows, and changes nothing. See Importing data.

Found something wrong or unclear on this page? , with the page address.