SQL (Structured Query Language) files contain code that helps access and modify data in relational databases.
To export data to SQL:
1. Open the Data Export wizard in one of these ways:
On the Start Page, select Data Pump > Export Data.
In Database Explorer, right-click the required database or server connection and select Tasks > Export Data.
In Database Explorer, right-click the required table or view and select Export Data.
On the menu bar, select Database > Tasks > Export Data.
In Data Editor, click
or right-click in the grid and select Export Data. You can export either the selected rows or the entire table.
2. On the Export format page, select SQL, then click Next.
Tip
Click Load Template to load export options from a template file if you saved it previously.
Note
To move between pages, click Next or select a page directly from the navigation pane on the left.
To return to the previous step and review or change your settings, click Back.
To close the wizard without saving your changes, click Cancel.

3. On the Source page, specify the connection details and select tables and/or views that you want to export, then click Next.
Note
The Source page is unavailable if you open the Data Export wizard from Data Editor.
3.1. In Connection, select the server connection for the database. You can also create a new connection or update an existing one.
Tip
To create or update a server connection:
1. In Connection, select Manage.
2. In the Connection Manager dialog, click New to create a connection or Edit to modify an existing one.
3. In the Database Connection Properties dialog, configure connection settings.
4. In the Connection Manager dialog, click OK to use the connection for the export.
3.2. In Database, select the database.
3.3. In Schema, select the appropriate database schema.
3.4. In the grid, select the required tables and/or views.
Tip
To export all tables and views, select Tables and Views.
To search for tables and views, enter a search query in the search box.

4. On the Output settings page, configure the output options for the exported data, then click Next.
4.1. Choose how you want to save the exported data.
Export data into separate files – Exports each selected table or view to a separate .sql file. Specify the path to the folder where the exported files will be saved.
Export data into single file – Exports all selected tables or views to a single .sql file. Specify the path to the file where the exported data will be saved.
The files selected for export appear in the Exported files preview area.
Note
When exporting data from a single table, Export data into single file is selected by default, and Export data into separate files is unavailable.
When exporting data from multiple tables, Export data into separate files is selected by default. To export all tables to a single file, select Export data into single file.
4.2. Optional: Select additional options for the exported files.
Append timestamp to the file name – Adds a timestamp to the file names. By default, the option is selected. To exclude the timestamp, clear the checkbox.
Auto delete old files – Automatically deletes exported files that are older than the specified number of days or when the number of exported files exceeds the specified limit.
Use compression (ZIP) – Creates an archive file with your exported data. Specify the compression level (No Compression, Best Speed, Fast, Default, Good, or Maximum), add a comment, encrypt your archive with AES128 or AES256, and specify a decryption password.
Note
Auto delete old files is available only when Append timestamp to the file name is selected.

5. On the Options page, configure the options for the SQL statements used in the export, then click Next.
5.1. Use the options depending on your source table or view configuration.
For single object export: In Destination table name, verify or update the name of the destination table for the exported data.
For multiple object export: Use Include database name in script to display the database name in the script. The option is selected by default. Clear the checkbox if you want to exclude the database name.
5.2. Under Statement Type, select the statement type for data export, such as INSERT, UPDATE, DELETE, or MERGE. The default type is INSERT.

6. On the Table columns page, select the columns for export, specify their corresponding key and destination columns, then click Next.
Note
dbForge Studio for SQL Server automatically maps fields and assigns a key to the first column in each table or view by default. To create a composite key, select more key columns.
All columns are included in the export by default. To export only specific columns, clear Column and select the required columns.

7. On the Exported rows page, specify the rows for export, then click Next.
Export all rows – Exports all rows in the table.
Export selected rows only – Exports only the rows selected in Data Editor.
Export a range of rows – Exports a specified range of rows. Enter the starting row and the number of rows to include in the export. To export all rows following the specified starting row, set Count to 0.

8. On the Errors handling page, choose how to process errors and how they should be logged.
8.1. Select one of the following error handling options:
Abort at the first error – Stops the export immediately when the first error occurs.
Prompt a user for an action – Stops the export when an error occurs and prompts the user to choose an action.
Ignore all errors – Continues the data export, skipping any errors without interruption.
8.2. Optional: To create a log file, select Write a report to a log file, then click the ellipsis (…) and select the folder where you want to save the file.

Note
To save your export settings as templates for recurring scenarios, expand the Save menu and select Save Template. You can then use the templates to export data from the command line.
9. Click Export.
10. On the Finish page, select one of the following actions:
Show log file – Opens the log file.
Open result file – Opens the exported file.
Open result folder – Opens the folder containing the exported file.
Export more – Starts another export.

11. Click Finish.