Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

How to implement a Type 3 SCD implemention for a field in a table?

$
0
0
Hi,
I have a existing ssis package. SSIS 2016.

Source is a text file with Employee data. Everyday, the full file will be there in a path.

From there, its loaded into a Stage table as is (truncate and load)

From stage table into main table, there is a stored procedure to load new records into the main table.

There is a stored procedure to update existing records into the main table, if there is any change in the columns. Type 1 SCD (No history maintained and update the changed records with the new value and then update the Record_Modified_Date column with the today's date.

Now, there is a new requirement -  there are two columns in the table - employee_current_location & EMployee_old_location. I have to implement the Type -3 implementation for these two columns.  

Example: For Empoyee ID=100, from the Source -> Employee_location = 'Delhi'
While transforming from stage to main table, the EMployee_Current_location should be 'Delhi' and  Employee_old_Location value is NULL.

Next day, from the source Employee_Location is 'Mumbai', then in the main table, 
EMployee_Current_location ='Mumbai' and EMployee_old_location ='Delhi'

Next day, from the source Employee_Location is 'Calcutta', then in the main table, 
EMployee_Current_location ='Calcutta',  and EMployee_old_location ='Mumbai'

So, basically, only for this field, current and Old value should be captured, using two different columns.

Can anyone help me on how to deal with this?

Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>