Page 1 of 1

How to load current table records to historical table in tgt

Posted: Wed Oct 10, 2007 12:15 am
by ashoks99
Hi i have a job designed for scd2,in the target i have 2 tables historical and current table.My question is how to move records from current table to histotrical table my client wanted to do this weekly once.
Help would be appriciated a lot.

Re: How to load current table records to historical table in

Posted: Wed Oct 10, 2007 1:15 am
by Havoc
ashoks99 wrote:Hi i have a job designed for scd2,in the target i have 2 tables historical and current table.My question is how to move records from current table to histotrical table my client wanted to do this weekly once.
Help would be appriciated a lot.
what is your target table structure? What are the columns used for identifying a history record ? Current Indicator.. Date Columns ?

Posted: Wed Oct 10, 2007 7:19 am
by jdmiceli
We definitely need more info, as Havoc said. I am doing similar things, but would need to know general table layout structure to see how you are doing it. The way I do it now is to populate the additional fields I use for historical tracking and current row recognition during the transfer process, then everything is an insert marking the most current row with a flag.

Bestest!

Thans for replay i have some information

Posted: Wed Oct 10, 2007 10:08 am
by ashoks99
In the target i have the following fields customer_ID,cust_state,Record_eft_dt and current_recoard_indicator so
if an update record comes then the fields Record_eft_dt should be with the updated date and the current_recoard_indicator should be "Y" here if the current_recoard_indicator already "Y" then it should be "N".
I hope its good information.Thanks,

Thans for replay i have some information

Posted: Wed Oct 10, 2007 10:09 am
by ashoks99
In the target i have the following fields customer_ID,cust_state,Record_eft_dt and current_recoard_indicator so
if an update record comes then the fields Record_eft_dt should be with the updated date and the current_recoard_indicator should be "Y" here if the current_recoard_indicator already "Y" then it should be "N".
I hope its good information.Thanks,

Posted: Wed Oct 10, 2007 5:02 pm
by ray.wurlod
As you're doing the load perform a lookup against the target (or a copy of same) to determine existence, and set your flag accordingly.