# \#snapshots

**URL:** https://discourse.getdbt.com/tag/snapshots/11.md?match_all_tags=true&page=1&tags%5B%5D=snapshots

[Latest](https://discourse.getdbt.com/latest.md) · [Categories](https://discourse.getdbt.com/categories.md) · [Tags](https://discourse.getdbt.com/tags.md)

**Page:** 2

---

## [Snapshots - put into same schema as primary tables?](https://discourse.getdbt.com/t/snapshots-put-into-same-schema-as-primary-tables/15477)

<div class="topic-metadata">

**Author:** [@dnewton\_nouria](https://discourse.getdbt.com/u/dnewton_nouria)\
**Replies:** 0\
**Last updated:** [September 17, 2024, 1:38pm UTC](https://discourse.getdbt.com/t/snapshots-put-into-same-schema-as-primary-tables/15477 "2024-09-17T13:38:53Z")

</div>

Hello, I am just starting to use Snapshots. I have my primary schema MARTS, and have also configured a custom schema MARTS\_STAGING which holds my staging tables. All good so far. In my scenario, I have some non-SCD t…

---

## [DBT Snapshots not handling Multiple Updates to the Same Unique Key](https://discourse.getdbt.com/t/dbt-snapshots-not-handling-multiple-updates-to-the-same-unique-key/15430)

<div class="topic-metadata">

**Author:** [@kneeyoh15](https://discourse.getdbt.com/u/kneeyoh15)\
**Replies:** 0\
**Last updated:** [September 13, 2024, 1:02pm UTC](https://discourse.getdbt.com/t/dbt-snapshots-not-handling-multiple-updates-to-the-same-unique-key/15430 "2024-09-13T13:02:02Z")

</div>

The problem I’m having I have a stage model with definition below. I make update to the Customer\_Name\_2 to One. cortex\_item\_sk cortex\_etl\_sk Customer\_Name\_2 cortex\_etl\_operation cortex\_etl\_timestamp 3c518f3d73fc…

---

## [Using DBT Snapshots across multiple projects](https://discourse.getdbt.com/t/using-dbt-snapshots-across-multiple-projects/15361)

<div class="topic-metadata">

**Author:** [@saksharma](https://discourse.getdbt.com/u/saksharma)\
**Replies:** 1\
**Last updated:** [September 10, 2024, 8:55am UTC](https://discourse.getdbt.com/t/using-dbt-snapshots-across-multiple-projects/15361 "2024-09-10T08:55:35Z")

</div>

The Problem I’m Facing I’m struggling to access snapshots from one dbt project within another dbt project. The Reason Behind This I want to maintain clean lineage across projects by selectively exposing certain snapshot…

---

## [Building snapshots on an append only table.](https://discourse.getdbt.com/t/building-snapshots-on-an-append-only-table/15002)

<div class="topic-metadata">

**Author:** [@Justin](https://discourse.getdbt.com/u/Justin)\
**Replies:** 0\
**Last updated:** [August 20, 2024, 9:17am UTC](https://discourse.getdbt.com/t/building-snapshots-on-an-append-only-table/15002 "2024-08-20T09:17:16Z")

</div>

My problem On snowflake I have a RAW, STAGING and MARTS database. In my RAW database I ingest data in an append only way. If a row in production gets updated it copies it to the RAW.SCHEMA.TABLE. This means that for one…

---

## [dbt cloud +Red-shift not recognizing columns while trying to run snapshot](https://discourse.getdbt.com/t/dbt-cloud-red-shift-not-recognizing-columns-while-trying-to-run-snapshot/14654)

<div class="topic-metadata">

**Author:** [@nehadarwin](https://discourse.getdbt.com/u/nehadarwin)\
**Replies:** 0\
**Last updated:** [August 2, 2024, 4:56pm UTC](https://discourse.getdbt.com/t/dbt-cloud-red-shift-not-recognizing-columns-while-trying-to-run-snapshot/14654 "2024-08-02T16:56:06Z")

</div>

Hi Team, Looking for some help.The current stack we have is snowflake, dbt core, fivetran. We are in process of moving to redshift and dbt. We have few snapshot which we are trying to load however running into errors. G…

---

## [Dynamically get snapshot strategy using macros](https://discourse.getdbt.com/t/dynamically-get-snapshot-strategy-using-macros/14062)

<div class="topic-metadata">

**Author:** [@kneeyoh15](https://discourse.getdbt.com/u/kneeyoh15)\
**Replies:** 2\
**Last updated:** [July 8, 2024, 1:39pm UTC](https://discourse.getdbt.com/t/dynamically-get-snapshot-strategy-using-macros/14062 "2024-07-08T13:39:14Z")

</div>

The problem I’m having using a macro to return the strategy type in a snapshot. The context of why I’m trying to do this I want to return the strategy based on a sql query using the macro below Some example code or err…

---

## [How to configure snapshot in dbt\_project.yml file](https://discourse.getdbt.com/t/how-to-configure-snapshot-in-dbt-project-yml-file/14079)

<div class="topic-metadata">

**Author:** [@ysreenu](https://discourse.getdbt.com/u/ysreenu)\
**Replies:** 1\
**Last updated:** [July 5, 2024, 8:40pm UTC](https://discourse.getdbt.com/t/how-to-configure-snapshot-in-dbt-project-yml-file/14079 "2024-07-05T20:40:11Z")

</div>

Hello everyone, I have succesfully created snapshot in config block.. Now I have been attempting to set up a snapshot in the dbt\_project.yml file. I created the order\_snap\_pro.sql file and placed it in the snapshots f…

---

## [Generate Snapshots Dynamically via macros](https://discourse.getdbt.com/t/generate-snapshots-dynamically-via-macros/13628)

<div class="topic-metadata">

**Author:** [@Yesh15](https://discourse.getdbt.com/u/Yesh15)\
**Replies:** 1\
**Last updated:** [June 11, 2024, 4:09am UTC](https://discourse.getdbt.com/t/generate-snapshots-dynamically-via-macros/13628 "2024-06-11T04:09:03Z")

</div>

Is there a way to create Snapshots Dynamically via macros instead of a model for each table ? We have landing schema of 400 tables, we need a schema with SCD2 tracking so we are using dbt snapshots for this RAW schema. I…

---

## [Snapshot: Parsing Error at path \[\]: Snapshots must be configured with a 'strategy', 'unique\_key', and 'target\_schema'](https://discourse.getdbt.com/t/snapshot-parsing-error-at-path-snapshots-must-be-configured-with-a-strategy-unique-key-and-target-schema/13280)

<div class="topic-metadata">

**Author:** [@ayushiverma994](https://discourse.getdbt.com/u/ayushiverma994)\
**Replies:** 1\
**Last updated:** [May 27, 2024, 2:10pm UTC](https://discourse.getdbt.com/t/snapshot-parsing-error-at-path-snapshots-must-be-configured-with-a-strategy-unique-key-and-target-schema/13280 "2024-05-27T14:10:47Z")

</div>

In dbt-core, I have created a folder under snapshots called salesforce. All my snapshot sqls are in this folder. Now I have a few common configs that I have added in dbt\_project.yml given below: snapshots: salesforce:…

---

## [How would you approach a data Model below?](https://discourse.getdbt.com/t/how-would-you-approach-a-data-model-below/12965)

<div class="topic-metadata">

**Author:** [@jimihcosta](https://discourse.getdbt.com/u/jimihcosta)\
**Replies:** 0\
**Last updated:** [April 19, 2024, 12:29pm UTC](https://discourse.getdbt.com/t/how-would-you-approach-a-data-model-below/12965 "2024-04-19T12:29:26Z")

</div>

Hi, How would you approach a dataset in the format below: Aggregate by different categories. Revenue in multiple time-frames (montly, ytd, ytd last 3 months) What is the best approach to have a final model as the ima…

---

## [Help Understanding Snapshots invalidate\_hard\_deletes](https://discourse.getdbt.com/t/help-understanding-snapshots-invalidate-hard-deletes/12764)

<div class="topic-metadata">

**Author:** [@bmalone-rover](https://discourse.getdbt.com/u/bmalone-rover)\
**Replies:** 1\
**Last updated:** [April 8, 2024, 3:06am UTC](https://discourse.getdbt.com/t/help-understanding-snapshots-invalidate-hard-deletes/12764 "2024-04-08T03:06:05Z")

</div>

I’m trying to understand the full impact of configuring invalidate\_hard\_deletes for snapshots. My understanding is this causes dbt to populate dbt\_valid\_to when a source record is recognized as deleted. Is this the only…

---

## [Using dynamic schemas for snapshots](https://discourse.getdbt.com/t/using-dynamic-schemas-for-snapshots/1070)

<div class="topic-metadata">

**Author:** [@claire](https://discourse.getdbt.com/u/claire)\
**Replies:** 10\
**Last updated:** [March 27, 2024, 1:19pm UTC](https://discourse.getdbt.com/t/using-dynamic-schemas-for-snapshots/1070 "2024-03-27T13:19:34Z")

</div>

Unlike models, snapshots build into the same target\_schema, no matter who is running them. This helps ensure that whenever you ref a snapshot, you’re using the production version of the snapshot, so that your dev transf…

---

## [Dynamic values for check\_cols attribute in the snapshot config using dbt-bigquery](https://discourse.getdbt.com/t/dynamic-values-for-check-cols-attribute-in-the-snapshot-config-using-dbt-bigquery/10620)

<div class="topic-metadata">

**Author:** [@vkarthik21](https://discourse.getdbt.com/u/vkarthik21)\
**Replies:** 2\
**Last updated:** [March 21, 2024, 3:27pm UTC](https://discourse.getdbt.com/t/dynamic-values-for-check-cols-attribute-in-the-snapshot-config-using-dbt-bigquery/10620 "2024-03-21T15:27:27Z")

</div>

The problem I’m having Unable to execute macro which brings in column names of table from INFORMATION\_SCHEMA.TABLES and use it as value for check\_cols in the snapshot model configuration. The context of why I’m trying t…

---

## ['dbt snapshot' fails when run 3rd time onwards](https://discourse.getdbt.com/t/dbt-snapshot-fails-when-run-3rd-time-onwards/12462)

<div class="topic-metadata">

**Author:** [@wilbert.weterings](https://discourse.getdbt.com/u/wilbert.weterings)\
**Replies:** 0\
**Last updated:** [March 13, 2024, 3:35pm UTC](https://discourse.getdbt.com/t/dbt-snapshot-fails-when-run-3rd-time-onwards/12462 "2024-03-13T15:35:25Z")

</div>

The problem I’m having The 3rd time onwards I try to run a ‘dbt snapshot’ command, it fails on an ‘Ambiguous column’ reference. First time ‘dbt snapshot’: timestamp 1 id 1 value 1 Result: the record gets inserted. S…

---

## [Snapshots rebuilt in every run](https://discourse.getdbt.com/t/snapshots-rebuilt-in-every-run/11975)

<div class="topic-metadata">

**Author:** [@fije\_red](https://discourse.getdbt.com/u/fije_red)\
**Replies:** 2\
**Last updated:** [February 12, 2024, 9:31am UTC](https://discourse.getdbt.com/t/snapshots-rebuilt-in-every-run/11975 "2024-02-12T09:31:26Z")

</div>

The problem I’m having Every time I run dbt build or dbt snapshot, the snapshots are rebuilt. It isn’t checking the previous data, only inserting the most recent data with new dates. The context of why I’m trying to do …

---

## [Snapshots failing with Duplicate DBT\_SCD\_IDs](https://discourse.getdbt.com/t/snapshots-failing-with-duplicate-dbt-scd-ids/8671)

<div class="topic-metadata">

**Author:** [@og\_dbt\_data](https://discourse.getdbt.com/u/og_dbt_data)\
**Replies:** 1\
**Last updated:** [February 9, 2024, 11:36am UTC](https://discourse.getdbt.com/t/snapshots-failing-with-duplicate-dbt-scd-ids/8671 "2024-02-09T11:36:17Z")

</div>

The problem I’m having My snapshots are failing due to duplicate rows already existing in the snapshot table. However, when I query the table, I see duplicate dbt\_SCD\_IDs. My source data does not have duplicates. I’m …

---

## [Using Pre-Hooks to Define Table DDL](https://discourse.getdbt.com/t/using-pre-hooks-to-define-table-ddl/11559)

<div class="topic-metadata">

**Author:** [@MegaMane](https://discourse.getdbt.com/u/MegaMane)\
**Replies:** 3\
**Last updated:** [January 15, 2024, 5:54pm UTC](https://discourse.getdbt.com/t/using-pre-hooks-to-define-table-ddl/11559 "2024-01-15T17:54:49Z")

</div>

The problem I’m having Hello, I’m working with dbt core in databricks. I’m trying to test the ability to define the DDL for a table using a pre-hook. So I’ve created a macro called “create\_my\_table.sql” that contains t…

---

## [How to query for a single row when using BETWEEN on valid\_from and valid\_to](https://discourse.getdbt.com/t/how-to-query-for-a-single-row-when-using-between-on-valid-from-and-valid-to/11489)

<div class="topic-metadata">

**Author:** [@to.chandler](https://discourse.getdbt.com/u/to.chandler)\
**Replies:** 2\
**Last updated:** [January 10, 2024, 11:11pm UTC](https://discourse.getdbt.com/t/how-to-query-for-a-single-row-when-using-between-on-valid-from-and-valid-to/11489 "2024-01-10T23:11:33Z")

</div>

For my snapshot tables, I want to be able to see the state of a row at a given time. However, the VALID\_TO of a row and the VALID\_FROM of the next row overlap (ex. both equal ‘2024-01-10’) So a query with “WHERE ‘2024-…

---

## [snapshots when column data type changes](https://discourse.getdbt.com/t/snapshots-when-column-data-type-changes/10452)

<div class="topic-metadata">

**Author:** [@diloloan72](https://discourse.getdbt.com/u/diloloan72)\
**Replies:** 1\
**Last updated:** [October 30, 2023, 12:25am UTC](https://discourse.getdbt.com/t/snapshots-when-column-data-type-changes/10452 "2023-10-30T00:25:53Z")

</div>

I have been creating snapshots of a table fine. However, recently, one column changes data type from number to boolean, so the snapshot run has been failing ever since, returning this error Expression type does not match…

---

## [Cannot preview the snapshots result in the dbt cloud IDE anymore.](https://discourse.getdbt.com/t/cannot-preview-the-snapshots-result-in-the-dbt-cloud-ide-anymore/9807)

<div class="topic-metadata">

**Author:** [@dbt-user](https://discourse.getdbt.com/u/dbt-user)\
**Replies:** 0\
**Last updated:** [September 1, 2023, 11:31am UTC](https://discourse.getdbt.com/t/cannot-preview-the-snapshots-result-in-the-dbt-cloud-ide-anymore/9807 "2023-09-01T11:31:06Z")

</div>

When I click on the preview button of a snapshot in the dbt cloud IDE, I get the following error: Error while parsing node: inline\_query Encountered unknown tag 'snapshot'. line 1 {% snapshot d\_dummy\_snapshot %} T…

---

## [Good practices & incremental models for SQL Server](https://discourse.getdbt.com/t/good-practices-incremental-models-for-sql-server/9707)

<div class="topic-metadata">

**Author:** [@albertovpd](https://discourse.getdbt.com/u/albertovpd)\
**Replies:** 0\
**Last updated:** [August 25, 2023, 12:02pm UTC](https://discourse.getdbt.com/t/good-practices-incremental-models-for-sql-server/9707 "2023-08-25T12:02:24Z")

</div>

Hi there! I am a little bit blocked regarding the use, in a SQL server of: Jinja templating dbt incremental models dbt Snapshots The problem I’m having: 1. How to compile a query to run it in a SQL server When decla…

---

## [best way to have a fixed table](https://discourse.getdbt.com/t/best-way-to-have-a-fixed-table/9538)

<div class="topic-metadata">

**Author:** [@greenglass](https://discourse.getdbt.com/u/greenglass)\
**Replies:** 1\
**Last updated:** [August 15, 2023, 2:53am UTC](https://discourse.getdbt.com/t/best-way-to-have-a-fixed-table/9538 "2023-08-15T02:53:41Z")

</div>

I have a table, let’s call it “customers\_monthly” that shows the amount of customers per month. With this table and a “pricing\_table” I calculate the billing revenue of a company in a table called “billing\_revenue\_table…

---

## [dbt snapshots: How to backfill from a table without updated\_at/created\_at timestamp?](https://discourse.getdbt.com/t/dbt-snapshots-how-to-backfill-from-a-table-without-updated-at-created-at-timestamp/9347)

<div class="topic-metadata">

**Author:** [@philippefutureboy](https://discourse.getdbt.com/u/philippefutureboy)\
**Replies:** 0\
**Last updated:** [July 30, 2023, 11:13pm UTC](https://discourse.getdbt.com/t/dbt-snapshots-how-to-backfill-from-a-table-without-updated-at-created-at-timestamp/9347 "2023-07-30T23:13:24Z")

</div>

Note: This issue has also been posted on StackOverflow, and can be found here. We have several years worth of daily SELECT \* FROM source.table captures for a given table. We want to create a dbt snapshot that tracks row…

---

## [how to meet the requirement for the traditional design pattern for scd type 2 dimensional tables in the mart layer using dbt](https://discourse.getdbt.com/t/how-to-meet-the-requirement-for-the-traditional-design-pattern-for-scd-type-2-dimensional-tables-in-the-mart-layer-using-dbt/9321)

<div class="topic-metadata">

**Author:** [@bytebugs](https://discourse.getdbt.com/u/bytebugs)\
**Replies:** 2\
**Last updated:** [July 28, 2023, 6:52am UTC](https://discourse.getdbt.com/t/how-to-meet-the-requirement-for-the-traditional-design-pattern-for-scd-type-2-dimensional-tables-in-the-mart-layer-using-dbt/9321 "2023-07-28T06:52:58Z")

</div>

I want to establish how to meet the requirement for the traditional design pattern for scd type 2 dimensional tables in the mart layer using dbt. I cannot determine if an out-of-the-box feature exists to do the same in t…

---

## [Are snapshots a type of materialization?](https://discourse.getdbt.com/t/are-snapshots-a-type-of-materialization/9169)

<div class="topic-metadata">

**Author:** [@soumaya.mauthoor](https://discourse.getdbt.com/u/soumaya.mauthoor)\
**Replies:** 0\
**Last updated:** [July 17, 2023, 1:33pm UTC](https://discourse.getdbt.com/t/are-snapshots-a-type-of-materialization/9169 "2023-07-17T13:33:40Z")

</div>

Are snapshots a type of materialization?

---

## [Snapshot not working](https://discourse.getdbt.com/t/snapshot-not-working/9006)

<div class="topic-metadata">

**Author:** [@AleckOliveira](https://discourse.getdbt.com/u/AleckOliveira)\
**Replies:** 0\
**Last updated:** [July 5, 2023, 12:55pm UTC](https://discourse.getdbt.com/t/snapshot-not-working/9006 "2023-07-05T12:55:16Z")

</div>

The problem I’m having: Hi! I’m trying to build a snapshot using the check strategy, but I can’t seem to make it work, and I’m not exactly sure why. I have a source table that looks like this: So I built a snapshot l…

---

## [snapshot on oracle](https://discourse.getdbt.com/t/snapshot-on-oracle/8814)

<div class="topic-metadata">

**Author:** [@Waffi](https://discourse.getdbt.com/u/Waffi)\
**Replies:** 0\
**Last updated:** [June 22, 2023, 10:54am UTC](https://discourse.getdbt.com/t/snapshot-on-oracle/8814 "2023-06-22T10:54:06Z")

</div>

Hello all dbt core newbie here! The problem I’m having I am using dbt core in a PoC on top of Oracle. When I run dbt snapshot command, first run will create the history table. Second run dbt will attempt to create the…

---

## [archive in Snowflake using dbt](https://discourse.getdbt.com/t/archive-in-snowflake-using-dbt/8670)

<div class="topic-metadata">

**Author:** [@samik](https://discourse.getdbt.com/u/samik)\
**Replies:** 0\
**Last updated:** [June 12, 2023, 12:25pm UTC](https://discourse.getdbt.com/t/archive-in-snowflake-using-dbt/8670 "2023-06-12T12:25:41Z")

</div>

Hello Community, I am having a use case in my engagement where I need to archive data from reporting table in Snowflake to another table at a monthly cadence. The purpose of this archive is the end user wants to do anal…

---

## [materialized= 'snapshot' works on models but it is not documented](https://discourse.getdbt.com/t/materialized-snapshot-works-on-models-but-it-is-not-documented/8529)

<div class="topic-metadata">

**Author:** [@robertk](https://discourse.getdbt.com/u/robertk)\
**Replies:** 0\
**Last updated:** [June 1, 2023, 2:03pm UTC](https://discourse.getdbt.com/t/materialized-snapshot-works-on-models-but-it-is-not-documented/8529 "2023-06-01T14:03:17Z")

</div>

Since snapshot is implemented as a materialization, it is perfectly fine to use it as a scd2 type loading on models, and it works as expected. It even makes sense for loading dimension tables in data marts. Why is the …

---

## [Are Snapshots Views?](https://discourse.getdbt.com/t/are-snapshots-views/7939)

<div class="topic-metadata">

**Author:** [@VDFaller](https://discourse.getdbt.com/u/VDFaller)\
**Replies:** 0\
**Last updated:** [April 21, 2023, 12:49am UTC](https://discourse.getdbt.com/t/are-snapshots-views/7939 "2023-04-21T00:49:05Z")

</div>

Question This isn’t really looking for help but I’m noticing, at least on databricks, when I try to do a snapshot I get . \[UC\_COMMAND\_NOT\_SUPPORTED\] Creating a persistent view that references both Unity Catalog and Hive…

[Previous page](https://discourse.getdbt.com/tag/snapshots/11.md?match_all_tags=true&tags%5B%5D=snapshots)

[Next page](https://discourse.getdbt.com/tag/snapshots/11.md?match_all_tags=true&page=2&tags%5B%5D=snapshots)
