RazorSQL How to Export Data

The first step before exporting data is to get connected to a database. For more information on getting connected, see How to Get Connected.

Once connected to a database, users can export data by selecting the DB Tools -> Export option, selecting the export data option from the right-click menu of the database browser, selecting the export toolbar icon, or by executing a query and then selecting the export icon from the query results panel.

Once the export option is selected, a window will appear with various export options. Listed below is information about each of these options:

Escape Single Quotes: Select this box if you would like single quotes to be escaped. This is useful if exporting in a format that will be executed as SQL.

Escape Character: The character to use if escaping single quotes.

Include Column Names: Select this option if you would like the column names to be included in the exported data. This applies to all export types. If this option is selected for Insert Statements, the generated SQL insert statement will format the SQL to include all of the column names.

Convert Nulls to Blanks - If the export type selected is not SQL Insert, then this option will convert null values to blanks in the exported data. This should generally be selected especially for HTML, XML, and Text exporting. For excel or delimited file exporting, if the exported data is for display purposes, nulls should probably be converted to blanks.

Wrap Values in Quotes when Delimiter Found in Value - If you are exporting delimited data, and there is a delimiter found in the actual data, this option will wrap the entire data value in quotes. Doing this allows the exported data to be re-imported.

The following export types are supported:

Delimited File: This option allows data to be exported using a delimiter. Each column is separted by the specificed delimer, usually a comma, tab, or space.

If selecting the delimited file option, the user can choose to export data with one line of the export file corresponding to one row of the data, or to combine all data and separate each value with a delimiter.

The "combine all data" option would typically be selected if there are line breaks in the data to be exported.

Insert Statements: This option is not available for query results, but is available if exporting a single table or all tables in a database / schema.

The Insert Statements option allows users to export data as SQL insert statements. To also export the Create and / or Alter table DDL statements, select the "Generate DDL Statements" option.

HTML: This option allows users to export data in HTML table format.

XML: This option allows users to export data in XML format.

XLSX: This option allows users to export data in Microsoft Excel XLSX format.

XLS: This option allows users to export data in Microsoft Excel format (97 - 2003).

Text: This option allows users to export data in text format. The Export Tool will attempt to align columns to make them symmetrical.

Once an export type is selected, the user will be prompted to specify a file. This file will be used to store the exported data.