SSIS FLAT FILE Destination

The SSIS FLAT FILE Destination is used to write data to a text file present in the File System. The text file can be in fixed width, delimited, ragged right, or fixed width with row delimiter.

NOTE: The SSIS FLAT FILE Destination uses a Flat File Connection Manager to create connection with files.

Configuring SSIS Flat File Destination

STEP 1: Drag and drop the data flow task from the toolbox to control flow and rename it to SSIS FLAT FILE Destination.

SSIS FLAT FILE Destination 1

Double click on it will open the SSIS data flow tab.

STEP 2: Drag and drop OLE DB Source and Flat File destination on to the data flow region. In this example, we will explain only about Flat File destination so, Please refer to OLE DB Source in SSIS article.

SSIS FLAT FILE Destination 2

Double click on Flat File Destination in the data flow region will open the Flat File Destination Editor to configure the connection manager settings. If you haven’t created Flat File Connection Manager before click on the New button and configure it.

SSIS FLAT FILE Destination 3

Once you click on the New button, the Flat File Format window will open. It provides four options, such as Delimited, Fixed Width, Fixed Width with row delimiters, and ragged right. For this example, we are selecting the Delimited option, but Please choose the option you want to use and click the OK button.

SSIS FLAT FILE Destination 4

Once you click on the OK button, a new window called Flat File Connection Manager Editor opened. Here, click on the Browse button to traverse the file system and locate the required file. If you select the Existing File option then, choose from the file system; otherwise, create one. Here, we are selecting the existing file.

SSIS FLAT FILE Destination 5

Once you selected the file, we have to specify whether our text file holds column names in the first row or not by check-marking Column names in the first data row option. Since our flat-file contains the column names in the first row, we are check-marking the option. If your text file is different, then don’t select it.

SSIS FLAT FILE Destination 6

Format: Here, you can select the Format you want to use while writing data to the text file.

SSIS FLAT FILE Destination 7

Header Row Delimiter: Please select the header row delimiter

SSIS FLAT FILE Destination 8

Let us check the data by visiting Columns Tab in Flat File Connection Manager

SSIS FLAT FILE Destination 9

Click on the preview button to see the data preview.

SSIS FLAT FILE Destination 10

Next, please click on the Mappings tab to check whether the source columns exactly mapped to the destination columns.

SSIS FLAT FILE Destination 11

Click OK to finish configuring SSIS Flat File destination package. Let us run and see whether we successfully transferred the SQL table rows into the flat file or not.

SSIS FLAT FILE Destination 12

From the below screenshot, you can observe that we transferred the SQL table rows into the SSIS flat file destination text file.

SSIS FLAT FILE Destination 13