How to generate data for both History and Current : I need to generate a report from existing tables with scd stored. 

Imagine i have a table1

table1 

>Pid|eff_dt|exp_dt

>489|2018-11-02 05:27:12.049|9999-12-31 23:59:59.000

>546|2018-11-02 05:27:12.049|2018-12-02 05:27:12.049

>546|2018-12-02 05:27:12.049|9999-12-31 23:59:59.000

table2

>Pid|val|eff_dt|exp_dt

>489|JD7G|2018-11-02 05:24:16.438|2018-11-09 05:40:47.203

>489|JD7|2018-11-09 05:40:47.203|9999-12-31 23:59:59.000

>546|TR56|2018-11-09 05:40:47.203|9999-12-31 23:59:59.000


Expected Output is :

>Pid|val|eff_dt|exp_dt

>489|JD7G|2018-11-02 05:27:12.049|9999-12-31 23:59:59.000

>489|JD7|2018-11-02 05:27:12.049|9999-12-31 23:59:59.000

>546|TR56|2018-11-02 05:27:12.049|2018-12-02 05:27:12.049

>546|TR56|2018-12-02 05:27:12.049|9999-12-31 23:59:59.000