Want to convert SQL file to TXT file?
If you want to export SQL Server to TXT, see this page: SQL Server to TXT.
If you want to export SQLite to TXT, see this page: SQLite to TXT.
Try Withdata Data File Converter, a desktop SQL to TXT converter for Windows, MacOS, and Linux, Convert SQL to TXT, Easy and Fast.
- Can run in GUI mode, Step by Step, just a few mouse clicks.
- Can run in Command line, for Scheduled Tasks and Streams.
- Convert files locally and privately, avoid uploading large SQL file(s) to online services.
- Support Windows, Linux, and macOS.
Download DataFileConverter
Windows 64 bit
Windows 32 bit
Linux .deb (For Debian, Ubuntu) 64 bit
Linux .rpm (For Red Hat, Fedora, SUSE) 64 bit
MacOS 64 bit
Convert SQL to TXT
Choose SQL file -> Set TXT file -> Convert SQL to TXT
“Start a New Convert” for “SQL to TXT”.
Select From “File” “SQL” To “File” “TXT”.
1. Open source SQL file.
Support large SQL file ( > 4GB ).
Source SQL file’s content is like this:
2. Config target TXT file.
3. Set rows options.
4. Convert SQL to TXT.
After converting, you can view the output TXT file.
More about SQL to TXT converter
Download Withdata DataFileConverter
Windows 64 bit
Windows 32 bit
Linux .deb (For Debian, Ubuntu) 64 bit
Linux .rpm (For Red Hat, Fedora, SUSE) 64 bit
MacOS 64 bit
See also:
SQL → TXT reference
Type mapping
| Value kind | in SQL | in TXT |
|---|---|---|
| Int | INT | 1234, or right-aligned in a fixed-width column |
| Bigint | BIGINT | 9007199254740993 |
| Decimal | DECIMAL(p,s) | 1234.56 |
| Float | DOUBLE PRECISION | 1.234e+10 |
| Text | VARCHAR(n) | written as-is; padding depends on the chosen layout |
| Long text | TEXT / CLOB | written as-is |
| Date | DATE | whatever the writer chose |
| Datetime | TIMESTAMP | whatever the writer chose |
| Binary | BLOB / BYTEA | not representable |
| Boolean | BOOLEAN / SMALLINT | Y / N, or 1 / 0, or TRUE / FALSE |
| JSON | JSON / TEXT | written as-is |
Dialect differences
Both SQL and TXT are file formats, so what differs below is how each one chooses to represent a value.
| Property | in SQL | in TXT |
|---|---|---|
| identifiers | Two competing conventions: single-quoted literals and diale... | None by convention |
| dates | Depends on the dialect: DATE literals, TO_DATE(), or plain ... | Whatever the writer produced; no convention is guaranteed |
| binary | Dialect-specific: X-quoted literal, 0x hex, or decode() | Not supported |
| separator | Statement terminators (;) | Whatever was chosen - often fixed column widths |
| encoding | No declaration | No declaration - UTF-8 works only with a BOM |
| typing | Types belong to the target database, and they differ betwee... | None - every field is text |
| shape | Statements; a dump usually means CREATE TABLE plus INSERT rows | Free form; a parser has to be told the layout |
| ceiling | No formal limit, but a single INSERT statement has to fit i... | No formal limit |
Convert SQL to TXT the easy way
Use the SQL to TXT converter — an offline desktop app for Windows, macOS and Linux. Nothing to upload, large files and batch runs supported (free trial).