SSIS Load Ragged Right Fixed Width File Data to SQL Server

This SSIS Integration Services article shows how to load data from a Ragged Right Fixed Width Flat file to the SQL Server table with an example. To demonstrate this example, we use the Employee Ragged Right Fixed Width text file that we generated previously.

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

Add Data Flow Task to Package

SSIS Load Ragged Right Fixed Width File Data to SQL Server

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 Ragged Right Fixed Width file. For more Data Loading options >> Click Here.

SSIS Load Ragged Right Fixed Width Flat File Data to SQL Server 2

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

Change Default Format to Ragged Right

Within the Column tab, we have to mark the starting points of each column. Please click on the empty space before each column starts to generate a black line to specify the column’s start point.

mark the starting points of each column

Use the advanced section to change the column 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 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.

Check the input and available destination column mapping

Run the SSIS Load Ragged Right Fixed Width Text or Flat File Data to SQL Server package.

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

Open the SQL Management Studio to see the SQL table result.

View result