In this task, you add a Flat File connection manager to the package that you just created. A Flat File connection manager enables a package to extract data from a flat file. Using the Flat File connection manager, you can specify the file name and location, the locale and code page, and the file format, including column delimiters, to apply when the package extracts data from the flat file. In addition, you can manually specify the data type for the individual columns, or use theSuggest Column Types dialog box to automatically map the columns of extracted data to Integration Services data types.
You must create a new Flat File connection manager for each file format that you work with. Because this tutorial extracts data from multiple flat files that have exactly the same data format, you will need to add and configure only one Flat File connection manager for your package.
For this tutorial, you will configure the following properties in your Flat File connection manager:
You must create a new Flat File connection manager for each file format that you work with. Because this tutorial extracts data from multiple flat files that have exactly the same data format, you will need to add and configure only one Flat File connection manager for your package.
For this tutorial, you will configure the following properties in your Flat File connection manager:
- Column names Because the flat file does not have column names, the Flat File connection manager creates default column names. These default names are not useful for identifying what each column represents. To make these default names more useful, you need to change the default names to names that match the fact table into which the flat file data is to be loaded.
- Data mappings The data type mappings that you specify for the Flat File connection manager will be used by all flat file data source components that reference the connection manager. You can either manually map the data types by using the Flat File connection manager, or you can use the Suggest Column Types dialog box. In this tutorial, you will view the mappings suggested in the Suggest Column Types dialog box and then manually make the necessary mappings in the Flat File Connection Manager Editor dialog box.
To add a Flat File connection manager
- Right-click anywhere in the Connection Managers area, and then click New Flat File Connection.
- In the Flat File Connection Manager Editor dialog box, for Connection manager name, type Sample Flat File Source Data.
- Click Browse.
- In the Open dialog box, locate the sample data folder and open the SampleCurrencyData.txt file. By default, the tutorial sample data is installed to the c:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Tutorial\Creating a Simple ETL Package\Sample Data folder.
To set locale sensitive properties
- In the Flat File Connection Manager Editor dialog box, click General.
- Set Locale to English (United States) and Code page to 1252.
To rename columns in the Flat File connection manager
- In the Flat File Connection Manager Editor dialog box, click Advanced.
- In the property pane, makes the following changes:
- Change the Column 0 name property to AverageRate.
- Change the Column 1 name property to CurrencyID.
- Change the Column 2 name property to CurrencyDate.
- Change the Column 3 name property to EndOfDayRate.
Note:By default, all four of the columns are initially set to a string data type [DT_STR] with an OutputColumnWidth of 50.
No comments:
Post a Comment