T-SQL (SCD) Slowly Changing Dimension Type 2 using a merge statement
- by AtulThakor
Working on stored procedure recently which loads records into a data warehouse I found that the existing record was being expired using an update statement followed by an insert to add the new active record. Playing around with the merge statement you can actually expire the current record and insert a new record within one clean statement. This…