TXT is a file format used to store plain text that can be opened in any text editor on any operating system.
To export SQL Server data to a text file:
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 anywhere 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 Text, then click Next.
Tip
Click Load Template to load export options from a template file if you saved it previously.
Note
You can move between pages by clicking Next or by selecting a page directly in the wizard.

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 select this connection for data 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 separated files – Exports each selected table or view to a separate .txt 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 file. Specify the path to the file where the exported data will be saved.
The export files are displayed under Exported files preview.
Note
When exporting data from a single table, the Export data into single file option is selected by default, and the Export data into separated files option is unavailable.
When exporting data from multiple tables, the Export data into separated files option is selected by default. To export all tables into a single file, select the Export data into single file option.
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 files. Additionally, you can 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
The Auto delete old files option is available only when the Append timestamp to the file name option is selected.

5. On the Options page, configure the text format and table grid options for the exported data, then click Next.
5.1. Specify text formatting, alignment, and column width.
Use Unicode – Exports data in the Unicode format.
Show a table header – Displays a header in the exported text.
Text alignment – Aligns text in each column: Left, Center, Right.
Column length – Sets the width of each column in characters.
5.2. Under Show grid, specify grid lines separating rows and columns in the exported text.
Horizontal header – Displays a symbol for horizontal header borders.
Vertical header – Displays a symbol for vertical header borders.
Horizontal – Displays a symbol for row separators in the exported grid.
Vertical – Displays a symbol for column separators in the exported grid.
5.3. Under Tab, specify how you want to handle tabs in the exported text.
Keep tabs – Preserves tabs in the exported text.
Insert spaces – Replaces tabs with a specified number of spaces.
The results of your configuration are displayed in Sample.

6. On the Data formats page, select the columns for export and specify their data formats, then click Next.
6.1. On the Columns tab, select the columns for export and check or edit their aliases and data types.
6.2. On the Formats tab, change the default format settings for Date, Time, Date Time, Currency, Float, Integer, Boolean, and Null String, and select the required binary encoding from the dropdown list.

7. On the Exported rows page, specify the rows to 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 the 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.