Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

SCD Type 2

$
0
0

Hi All,

I have a typical requirement of implementing a Type 2 scd for following table

Staging Table
MEMBER_ID,COV_MTH_ID,RELATION,MARITAL_STATUS
1001      201401               10               M
1001      201402               12               M
1001      201403               12               U
1001      201404               10               M

Type 2 Dimenion
MEMBER_ID,RELATION,MARITAL_STATUS,EFF_DTTM,  EXPIR_DTTM
1001              10                    M               2014-01-01 2014-01-31
1001              12                    M               2014-02-01 2014-02-28
1001              12                    U               2014-03-01 2014-03-31
1001              10                    M               2014-04-01 2014-04-30

I require a sql query which i can put it in a SP to get this result.

Thanks in advance

--Raja


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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