Skip to Content
0
Oct 02, 2013 at 12:48 PM

SCD problem

23 Views

hi guys

i am getting problem in history preserving part..

see the sample data, in table_comparison transform on left side i put source_id and on right hand side code column... what is happening right now it TC comparing the staging table data with sur_id 202 which is the max id in target table.. and thinks that there is no update... but as the row with sur_id doesn't exist.. so it should be get updated with flag as 'N' and second row should remain as it is...

i have tried checking the radio button(detect delete rows) in TC but that also not working...

could anyone help me to fix this issue..

create table #temp_stg -- staging table

(source_id int,

code varchar(10))

insert into #temp_stg values ( 101, 'p1')

select * from #temp_stg

-------------------------------------

create table #temp -- target table

(sur_id int,

source_id int,

code varchar(10),

current_flag varchar(1))

insert into #temp values (201, 101, 'p','Y')

insert into #temp values (202, 101, 'p1','Y')

select * from #temp