Skip to content

Convert SQL to XLS

Export database query results to an editable legacy Excel workbook.

Convert SQL files online

We don’t have a dedicated online converter for SQL to XLS yet, but you can convert SQL files online to these and more formats:

Want to convert SQL to XLS?

Let us know. We pick the conversions to add next by how many people ask for them.

How to convert sql to xls file

Teams commonly need spreadsheet copies of query results to share with colleagues who use Excel or systems that accept only the legacy .xls format. The conversion is an export of selected database results, not a direct change of the SQL script into a workbook.

What the SQL format is

A .sql file is plain text containing SQL statements, such as commands to create tables, insert records, or retrieve data. Database administrators and developers use these scripts to define or modify databases and run queries. A script may depend on a particular database engine, existing schema, and permissions; it is not necessarily a ready-made table of spreadsheet rows.

What the XLS format is

.xls is the Excel 97–2003 workbook format. It stores editable worksheets with cells, formulas, and formatting, and is supported by Excel and other spreadsheet programs. Each worksheet is limited to 65,536 rows and 256 columns, so larger results need multiple sheets or a newer format such as .xlsx.

How to export SQL results to XLS

Navicat Premium is a suitable offline option when it supports the database engine and SQL dialect used by the script:

  1. Connect Navicat to the correct database. Run scripts that change data only on a test or restored copy unless changes to the live database are intended.
  2. Open the SQL file in Navicat’s query editor, select the matching connection and database, and execute the script. Resolve errors such as unsupported syntax, missing tables, or insufficient permissions. If the script only creates or populates tables, run a separate SELECT query to choose the rows to export.
  3. Export the required table or query result with Navicat’s Export Wizard. Choose Excel and, if available, the Excel 97–2003 format; save the output with an .xls extension. Export separate result sets separately.
  4. If the installed Navicat version does not offer .xls, export as CSV, open the CSV in Excel, check the import delimiter and character encoding, then choose File → Save As and select Excel 97–2003 Workbook (*.xls).

A general-purpose online converter is not a reliable choice for an arbitrary SQL script: the script must be interpreted by a compatible database before its results can be exported. Avoid uploading database dumps containing confidential data to conversion sites.

Quality and compatibility

The workbook contains the exported rows, not the SQL commands, schema, indexes, relationships, or database logic. Check how the export represents NULL values, dates, decimals, and text identifiers with leading zeros; spreadsheet software may reinterpret values, and Excel retains only 15 significant digits in numeric cells. Confirm that the result fits the XLS row and column limits before exporting; use .xlsx or split the data when it does not.

SQL vs XLS: format comparison

How the SQL and XLS formats compare on the properties that matter most for this conversion.

Comparison of the SQL and XLS file formats
Property .SQL Structured Query Language script .XLS Microsoft Excel Spreadsheet
Open standard Partly open No
Compression Uncompressed Both
Typical file size Small Medium
Opens in a web browser No Partial
Further editing Easy Limited
Metadata support Basic Basic
Plain-text readable Yes No
Best used for Data exchange Data exchange
Introduced 1970 1987
Developer — Microsoft
MIME type application/sql application/vnd.ms-excel

Information about file extensions and file types is provided by File-Extensions.org

Additional formats for
sql file conversion

Reverse conversion

Convert to xls from
other formats

Share on social media:

Already downloaded

This file has already been downloaded. For your privacy it was deleted from our server right after the download, so it cannot be downloaded again. To get it once more, convert the file again.