SSIS Load Fixed Width Flat File Data to SQL Server

This SSIS Integration Services article shows how to load data from a Fixed Width Flat file to the SQL Server table with an example.

SSIS Load Fixed Width Flat File Data to SQL Server

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

Add Data Flow Task to Package

Double-click to open the SSIS Data Flow Region. Then, drag the flat file source and double-click on it to open the Source Editor. 

Click the New button to open the Flat File Connection Manager Editor window. Next, click the Browse button to choose the Fixed Width Flat file. For more Data Loading options >> Click Here.

SSIS Load Data From Fixed Width Flat File to SQL Server Table

First, change the Format from default Delimiter to Fixed Width. If the file’s first row has header names, checkmark the Column Names in the first data row option.

checkmark the Column Names in the first data row

By default, it will show a single line ending with the red line. We must use/drag the red line within the Column tab to view them. 

Let me drag the red line. Now, you can see all the columns with values.

Drag Red Line to see the Columns

Click on the empty space before each column starts to generate a black line that divides the columns.

SSIS Load Fixed Width Flat File Data to SQL Server 5

Use the advanced section to change the Data type. Here, the column data type must match the destination table; otherwise, it throws an error. After you finish, click OK to close the window.

advanced section to change the Data type

Next, drag the OLE DB Destination and double-click on it to open the Editor. Next, click the New button to configure the OLE DB Connection Manager.

Use OLEDB Destination to configure the OLE DB Connection Manager

Select the existing table from the list. If not, click the new button to create a new one.

Select the table from the list

Next, go to the Mappings tab to check the input and available destination column mapping. If not, assign them by dragging the lines or using a drop-down list.

check the input and available destination column mapping

Run the SSIS Load Fixed Width Flat File Data to SQL Server package.

Run the SSIS Load Fixed Width Flat File Data to SQL Server package

Open the SQL Management Studio to see the result.

View result