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

Implimenting SCD Type 2 using SQL Merge

$
0
0

Hello , 

I'm working on implimenting SCD type 2 to keep track of changes in dim_A with fields as

Table A

VQ_dim_Id , VQ_Name, Contact_Type , Contact_Type, Center_Node_Id , Sed_id , Eed_Id , Insert_date, IsCurrent

Table B

CT_Number, Virtual_Queue , Center_Node_ID , Center, Contact_Type.

Table B acts as source to determine changes for Updates and inserts for Table A .  with join condition on VQ_Name and Virtual_Queue ( Which is bad but business rules have no way to determined by ID)

my quesiton is I can update VQ_Name , Contact_Type , Center_Node_Id from Source (table B) , Is there any best practice in place where I can insert EED_Id, SED_id as well in case they are missing in the source... any code snippet to impliment SCD with this kinda functionality helpful !

Thank you ,

Vishal. 


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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