# Initialise snapshot with data from a dimension table

**URL:** <https://discourse.getdbt.com/t/initialise-snapshot-with-data-from-a-dimension-table/9791>\
**Category:** Help\
**Tags:** snowflake\
**Created:** [August 31, 2023, 9:55am UTC](https://discourse.getdbt.com/t/initialise-snapshot-with-data-from-a-dimension-table/9791 "2023-08-31T09:55:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nurianom](https://avatars.discourse-cdn.com/v4/letter/n/ed8c4c/32.png) [@nurianom](https://discourse.getdbt.com/u/nurianom)\
**Post date:** [August 31, 2023, 9:55am UTC](https://discourse.getdbt.com/t/initialise-snapshot-with-data-from-a-dimension-table/9791/1 "2023-08-31T09:55:26Z")

</div>

Hi,

We are trying to migrate tables from mssql into snowflake, some of these tables are dimensions tables from the source tables, with columns similar to the ones dbt snapshots have (dbt\_VALID\_FROM, dbt\_VALID\_TO, dbt\_SCD\_ID).

We have started using dbt to get the data from snowflake, create models to do some transformations and use snapshots. The problem we have is that we want to create snapshots for the source table and then continue using the snapshots with the data from snowflake, so we keep the history we had.

We have created staging files to get the data from the source tables, then created models to do the transformations and finally the snapshots. But the problem is that we get duplicate column name ‘dbt\_VALID\_FROM’ when creating the snapshot from the dimension table. Is there a way to initialized a snapshot using data from a history table and replacing the columns dbt\_VALID\_FROM, dbt\_VALID\_TO, dbt\_SCD\_ID with the ones we have (keeping the dbt column names)?

Thanks in advance!!

---

<div class="post-metadata">

**Author:** ![nurianom](https://avatars.discourse-cdn.com/v4/letter/n/ed8c4c/32.png) [@nurianom](https://discourse.getdbt.com/u/nurianom)\
**Post date:** [September 1, 2023, 11:13am UTC](https://discourse.getdbt.com/t/initialise-snapshot-with-data-from-a-dimension-table/9791/2 "2023-09-01T11:13:46Z")

</div>

I managed to fix my problem.  
We created a model using our source table and doing transformation of the timestamp columns to be the same as dbt\_VALID\_FROM, dbt\_VALID\_TO. Then we copy the table into a snapshot, and then run our snapshot using the current data as a source

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/1X/a7a7ca1fe379aaf90952b0e13118a817babcd14f.png) [@system](https://discourse.getdbt.com/u/system)\
**Post date:** [September 8, 2023, 11:13am UTC](https://discourse.getdbt.com/t/initialise-snapshot-with-data-from-a-dimension-table/9791/3 "2023-09-08T11:13:52Z")

</div>

Closed on September 8, 2023, 11:13am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
