CONFIGURING SSIS FLAT FILE CONNECTION MANAGER

A connection manager creates a pipeline between SSIS and the file location on your machine.

Add a Flat File connection manager to the SSIS package

  1. In the Solution Explorer pane, right-click on Connection Managers and select New Connection Manager.
C:\Users\user\Desktop\bluetooth\1746041331097.jpg
  1. In the Add SSIS Connection Manager dialog, select FLATFILE, then Add.
C:\Users\user\Desktop\bluetooth\1746041331062.jpg
  1. Search google for SampleCurrencyData.txt.
C:\Users\user\Desktop\bluetooth\1746041331012.jpg
  1. Open the data and download as Raw
C:\Users\user\Desktop\bluetooth\1746041330984.jpg
  1. Save it on your system, where you can easily navigate to, for this example, we save it in documents. 
C:\Users\user\Desktop\bluetooth\1746041330957.jpg
  1. In the Flat File Connection Manager Editor dialog box, for Connection manager name, enter Sample Flat File Source Data
C:\Users\user\Desktop\bluetooth\1746041330931.jpg
  1. Select Browse.
C:\Users\user\Desktop\bluetooth\1746041330900.jpg
  1. In the Open dialog box, locate the SampleCurrencyData.txt file on your computer and click open.
C:\Users\user\Desktop\bluetooth\1746041330870.jpg
  1. Un-mark the Column names in the first data row checkbox 
C:\Users\user\Desktop\bluetooth\1746041330846.jpg

Set Locale-Sensitive Properties

  1. In the Flat File Connection Manager Editor dialog box, select General.
  2. Set Locale to English (United States) and Code page to 1252.
C:\Users\user\Desktop\bluetooth\1746041330823.jpg

Rename Columns in the Flat File Connection Manager

  1. In the Flat File Connection Manager Editor dialog box, select Advanced.
C:\Users\user\Desktop\bluetooth\1746041330798.jpg
  1. In the property pane, change the Column 0 name property to AverageRate.
C:\Users\user\Desktop\bluetooth\1746041330774.jpg
  1. Change the Column 1 name property to CurrencyID.
C:\Users\user\Desktop\bluetooth\1746041330751.jpg
  1. Change the Column 2 name property to CurrencyDate.
C:\Users\user\Desktop\bluetooth\1746041330726.jpg
  1. Change the Column 3 name property to EndOfDayRate.
C:\Users\user\Desktop\bluetooth\1746041330703.jpg

Remap Column Data Types

By default, all four of the columns are initially set to a string data type [DT_STR] with an OutputColumnWidth of 50.

Integration Services automatically suggests appropriate data types based on the first 200 rows of data. You can also change these suggestion options to sample more or less data, to specify the default data type for integer or Boolean data, or to add spaces as padding to string columns.

In this tutorial, Integration Services suggests the data types shown in the second column of the following table for the data from the SampleCurrencyData.txt file. The fourth column provides the data types required for the columns in the destination, which are defined in a subsequent step.

Expand table

Flat File columnSuggested typeDestination columnDestination type
AverageRatefloat [DT_R4]FactCurrencyRate.AverageRatefloat
CurrencyIDstring [DT_STR]DimCurrency.CurrencyAlternateKeynchar(3)
CurrencyDatedate [DT_DATE]DimDate.FullDateAlternateKeydate
EndOfDayRatefloat [DT_R4]FactCurrencyRate.EndOfDayRatefloat
  1. In the list, select AverageRate, click on the data type, you will see a drop down, click on it and change to float[DT_R4].
C:\Users\user\Desktop\bluetooth\1746041330679.jpg
  1. In the list, select the CurrencyID column and in the property pane, change the Data Type of column CurrencyID from string [DT_STR] to Unicode string [DT_WSTR].
C:\Users\user\Desktop\bluetooth\1746041330656.jpg
  1. In the property pane, change the data type of column CurrencyDate from date [DT_DATE] to database date [DT_DBDATE].
C:\Users\user\Desktop\bluetooth\1746041330631.jpg
  1. Change the data type of column EndofDayRate from string[DT_STR] to float[DT_R4]
C:\Users\user\Desktop\bluetooth\1746041330608.jpg
  1. Select OK.
C:\Users\user\Desktop\bluetooth\1746041330586.jpg
  1. We have now created a flat file source connection manager which will bring in our data.
C:\Users\user\Desktop\bluetooth\1746041330561.jpg

Leave a Reply

Your email address will not be published. Required fields are marked *