# SCD type 2 in using dbt

**URL:** <https://discourse.getdbt.com/t/scd-type-2-in-using-dbt/2294>\
**Category:** Archive\
**Created:** [March 19, 2021, 2:46am UTC](https://discourse.getdbt.com/t/scd-type-2-in-using-dbt/2294 "2021-03-19T02:46:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![royb131](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@royb131](https://discourse.getdbt.com/u/royb131)\
**Post date:** [March 19, 2021, 2:46am UTC](https://discourse.getdbt.com/t/scd-type-2-in-using-dbt/2294/1 "2021-03-19T02:46:31Z")

</div>

Hi, have a question on dbt scd type 2.

We have source tables and dimension tables. Have the snapshot which is reading source table and capturing any changes to snapshot tables. Now, how should we insert and specially update the existing rows in dimension tables using snapshot or SCD works differently in DBT?

---

<div class="post-metadata">

**Author:** ![joellabes](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/joellabes/32/3980_2.png) [@joellabes](https://discourse.getdbt.com/u/joellabes)\
**Post date:** [March 22, 2021, 8:57am UTC](https://discourse.getdbt.com/t/scd-type-2-in-using-dbt/2294/2 "2021-03-22T08:57:34Z")

</div>

When you run dbt snapshot, it will take responsibility for identifying any changes according to your snapshot strategy (timestamp or check columns). From there, it will coordinate the DML to add new records to the SCD-2 table and close out any which are no longer active. You don’t need to manually write any insert or update statements

---

<div class="post-metadata">

**Author:** ![royb131](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@royb131](https://discourse.getdbt.com/u/royb131)\
**Post date:** [March 23, 2021, 3:16pm UTC](https://discourse.getdbt.com/t/scd-type-2-in-using-dbt/2294/3 "2021-03-23T15:16:41Z")

</div>

Thanks. Understood and implemented. Working like a charm.
