How to Export Tables from a Database


When sharing components or sending in a bug report, you need to include a backup of the table(s) referenced by the component. Otherwise, the component cannot be run. This article describes how to export data from tables in MySQL or SQL Server.

Exporting Tables Using Navicat

Navicat is a popular tool used by many Alpha Anywhere developers to work with SQL databases. Navicat's Export Wizard can be used to export multiple tables from a database to SQL files.

These instructions show creating a SQL dump from a SQL Server Express database using Navicat for SQL Server. However, the process is the same if you use Navicat for MySQL.
  1. In Navicat, expand the database that contains the tables you want to export. Click on "Tables" listed under the database in the database explorer to display all of the tables. Click on the Export Wizard toolbar button.

  2. On the first page in the export wizard, select SQL sript file (*.sql). Click Next>.

  3. Select the tables you wish to export. Click Next>.

  4. The columns to export page lists what columns from each table will be exported. By default, all columns from each table will be exported. Click Next>.

  5. On the additional options page, cick Next>.

  6. On the final page, click Start to export the data. When the export finishes, click Close. The generated SQL files will contain the create and insert statments necessary to import the tables to another database.

    Click Start to begin the export.
    Export is complete.

Exporting Tables Using MySQL Workbench

  1. In MySQL Workbench, click Data Export under the Management options to opent he Data Export tool.

  2. Click on the database you wish to export.

  3. Select the tables you want to export.

  4. Make sure Dump Structure and Data is selected for the Tables to Export dropdown box.

  5. Choose Export to Self-Contained File.

  6. Click Start to begin the export. Close the Data Export tool when the export is complete.


Exporting Tables Using SQL Server Management Studio

  1. Right-click on the database that contains tables you wish to export. Select Generate Scripts... under the Tasks submenu.

  2. Click Next > on the Introduction page.

    Generate and Publish Scripts Introduction page
  3. On the Choose Objects page, select all of the tables you wish to export. Click Next >.

    Generate and Publish Scripts Choose Objects page
  4. On the Set Scripting Options page, select Save scripts to a specific location. Choose the Save to file option with Single file selected. In the File name box, give the sql file a name. When you are done choosing the file name, click the Advanced button to configure additional export options

    Generate and Publish Scripts Set Scripting Options page
  5. In the Advanced Scripting Options, select Schema and data for the Types of data to script property. Click OK.

    Generate and Publish Scripts Advanced Scripting Options
  6. On the Summary page, click Next >.

    Generate and Publish Scripts Summary page
  7. Click Finish on the Save or Publish Scripts when the export completes.

    Generate and Publish Scripts Save or Publish Scripts page