SSIS Export SQL Data to Flat File with Text Qualifier

This SSIS article shows how to export SQL Server table records or data to a flat file with text qualifier (double quotes) as an example.

The below screenshot shows the records in the Employee table.

Employee Table

SSIS Export SQL Data to Flat File with Text Qualifier

Drag and drop the Data Flow Task into the control flow region.

Add Data Flow Task

Double-click to open the SSIS Data Flow Region. Then, drag the OLE DB Source and double-click on it to open the Editor. Next, click the New button to configure the OLE DB Connection Manager. Here, we have chosen the existing one, but you can create a new one by clicking the New button.

Add OLE DB Source to configure OLE DB Connection manager

We will choose the existing employee table from the list in this example. Next, go to the columns tab to check the columns and click the Ok button. For more Data Loading options >> Click Here.

Select the Employee table

Drag the flat file destination and connect the OLE DB source to it. Next, Double-click on the flat file destination to open the Editor, and click on the new button to choose the flat file format. Here, we have chosen the Delimited as the format option.

SSIS Export SQLServer Table Data to Flat File With Text Qualifier 1

Click the Browse button to create a new Employee with Double Quotes file to store the records.

Create a File to store rows

Next, specify the TextQualifier and checkmark the Column Names in the first data row option to copy the headers.

SSIS Export SQLServer Table Data to Flat File With Text Qualifier 3

Use the advanced tab to change the Data type or column names. After you finish, click OK to close the window.

Check or Change data Types and column names

Within the Flat File Destination Editor, go to the Mappings tab to check the input and available destination column mapping.

check the input and available destination column mapping

Run the SSIS Export SQL Server Table Data to Flat File with Text Qualifier package.

Run the SSIS Export SQL Server Table Data to Flat File with Text Qualifier package

As you can see, all the records in the flat file have double quotes as the text qualifier.

Records with Double Quotes

Let me change the Text qualifier to ** and run the package.

Run the SSIS Export SQL Server Table Data to Flat File with Text Qualifier package 8

See the result.

Result