1

Lets say I have a Flat File with 3 columns (EXAMPLE PIPE SEPARATED) This is Flat File

Name   | LastName | BirthDay
Arthur |   Tower  | 10-10-1990

Now in SSIS how can I add Columns but I want the column to have a specific text/number (value) on which I will specify the source since i will be importing data from different systems to the same SQL Table

Example of how I want to see once imported in SQL

Name    | LastName  |  BirthDay  | FileFrom
Arthur  |   Tower   | 10-10-1990 |  Facebook
Karen   |   Salty   | 12-19-1987 |  Twitter
Yahfoufi
  • 2,220
  • 1
  • 22
  • 41
Arturo
  • 43
  • 5
  • If fileFrom is a parameter you can add it to the data flow using a derived column. – KeithL Sep 15 '19 at 16:28
  • Yes I try to add the derived column, but I don't know how to set a default value por the column in this case, the value of the column should be "Twitter" , since this value doesn't come from the flatfile – Arturo Sep 15 '19 at 22:05

2 Answers2

0

You can read your data from the specific source then sort them based on your sort fields and then merge them with the data that you had(name,last name , birthday). Do not forget that name,last name , birthday need to be sorted too.

Merge Join Transformation

SSIS Basics: Using the Merge Join Transformation

programmer21
  • 173
  • 11
  • Thanks, good shared info sir ! Appreciated, I'm not sure I need a Join since the information is not in another table o file. It will be hard-coded by myself in the Derived Column, I'm pretty sure i did not explain myself correctly in my question – Arturo Sep 16 '19 at 17:42
0

Well this is what I did,

I added a Derived Column and on EXPRESSION I SET the following: REPLACENULL("TheValueINeeded","NULL")

To replace nulls with the value I wanted, I am not sure if this is the correct way to do it but it worked.

Now my imported data to SQL it's all the flat file info and in the last ADDED COLUMN I'm sending "TheValueINeeded".

Thanks for the help Stackers.

Arturo
  • 43
  • 5