Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Importing and Exporting Data » Exporting data from databases » Export tools

Using the OUTPUT statement to export data Next Page

Using the UNLOAD TABLE statement

The UNLOAD TABLE statement lets you export data efficiently in text/ASCII formats only. The UNLOAD TABLE statement exports one row per line, with values separated by a comma delimiter. The data is exported in order by primary key values to make reloading faster.

Use the UNLOAD TABLE statement when you:

Impact on the database

The UNLOAD TABLE statement places an exclusive lock on the whole table while you are unloading it.

If you have a choice between using the OUTPUT statement, UNLOAD statement, or UNLOAD TABLE statement, choose the UNLOAD TABLE statement for performance reasons.

For more information, see UNLOAD TABLE statement.


Using the SQL Anywhere sample database, you can unload the Employees table to a text file named employee_data.csv by executing the following command:

UNLOAD TABLE Employees TO 'employee_data.csv';

Because it is the database server that unloads the table, employee_data.csv specifies a file on the database server computer.