In this Step by Step tutorial I will show you how to work on Raw File Source. For the purpose of this tutorial I will use SSIS 2012.:
Raw file is literally ‘raw’ (010101) and we cannot create it manually, it requires raw file destination to create one.
Csv, txt and similar ones are all ‘flat file’ text files and can be opened and modified in notepad. The main difference is extension which means the structure (rules) might be slightly different. CSV by definition is “comma” separated but you can get a .csv file which has a “vertical bar” separator.
RAW file is special case as it contains metadata for the file (=much more stable) and structure is the same as SSIS Buffer (in memory table used for processing) so SSIS doesn’t have to translate it when this file is loaded into memory. RAW files are often slightly bigger than text files so pros and cons depend on a particular scenario.
We have a package here with a Data Flow task and we are inside the Data Flow tab and will show you how to import data from Raw File Source.
Drag and Drop Raw File Source component to Data Flow tab. It is one of the simplest to configure. We don’t have to create a Connection Manager, just double click it to configure the Editor screen.
Select the drop down button for ‘Access mode’ property and we notice there are only two options ‘File name’ and ‘File name from variable’. Choose the default setting ‘File name’ and press on ‘Browse’ button to choose a source file. In our case the file is “C:\SSIS\RowFileSampleTest”.
Navigate to ‘Columns’ page and ensure that the required columns are selected and mapped accordingly. We can change the name of the columns in the ‘Output Column’.
We have 4 columns in our sample file ‘ProductKey’ EnglishProductName’, ‘Standardcost’ and ‘English Description’.
To preview the data, drag and drop Derived Column transformation to the Data Flow tab, establish a Data Path between the 2 tasks, right-click on the Data Path and ‘Enable Data viewer’ option.
The Data viewer window pops up displaying the data fetched from the Raw File Source
Close this window and proceed to see that there are green arrow marks against each component to indicate that they have been executed successfully.
This is how we configure Row File Source component to extract data. Notice that when we click on Row File Source component we cannot redirect it to another component and also there is no Failure option (red arrow), which means that this cannot Fail.
Right-click on the Data Path and choose ‘Edit’ option. In the popup window that appears choose ‘Metadata’ page. We notice that the Raw file also contains information about the data type of each columns.
Also, right-click on the ‘Raw File Source’ component and choose ‘Show Advance Editor’ option. We see multiple tabs displaying information such as ‘Component Properties’, ‘Column Mappings’ and ‘Input and Output Properties’
So that’s all about ‘Raw File source’. Please visit our website for remaining articles, where we will explain how to use different destinations and sources.
Hope you enjoyed this tutorial.