Snowflake Dynamic Tables: When to Use Them and When to Stick with Streams/Tasks
Quick answer: Dynamic Tables are Snowflake's declarative approach to incremental pipelines. You write a SELECT, set a target_lag, and Snowflake handles the refresh. They suit SQL transformations such as star schema refreshes, and since July 2026 custom incremental dynamic tables can apply MERGE logic as well. Streams and Tasks remain the better fit for multi-step procedural logic, writing to several targets, external API calls and sub-minute latency.
Last updated: October 2026
Snowflake Dynamic Tables keep the result of a query up to date automatically, refreshing it to stay within a freshness target you set. A single CREATE DYNAMIC TABLE statement replaces the stream that tracks changes, the task that schedules processing and the stored procedure that runs the SQL in a classic pipeline. They suit transformation layers, from staging to marts, where data that is a minute to an hour old is acceptable. Streams and tasks remain the better choice for sub-minute latency or complex multi-step CDC logic. This guide compares the two with implementation examples.
That's the theory. In practice, there are real tradeoffs between Dynamic Tables and the Streams/Tasks pattern that determine which one you should use for a given pipeline. This guide walks through both approaches with enough detail that you can make that call for your own workloads.
What Dynamic Tables Actually Do
A Dynamic Table is a materialized result set that Snowflake keeps up to date automatically. You define it with a SQL SELECT statement and a target_lag parameter that tells Snowflake how stale the data is allowed to get. Snowflake's internal scheduler then figures out how often to refresh the table to meet that target.
Here's the key mental model: a Dynamic Table is like a materialized view that you can control the refresh frequency of. Except unlike materialized views in Snowflake (which are best for simple queries on a single table), Dynamic Tables support joins, aggregations, window functions, and CTEs.
Here's a real example. Say you have a raw orders table and a raw customers table, and you want a denormalized order_summary that joins them and adds some computed columns:
CREATE OR REPLACE DYNAMIC TABLE order_summary
TARGET_LAG = '10 minutes'
WAREHOUSE = transform_wh
AS
SELECT
o.order_id,
o.order_date,
o.total_amount,
c.customer_name,
c.segment,
o.total_amount - COALESCE(o.discount, 0) AS net_amount,
DATEDIFF('day', c.first_order_date, o.order_date) AS customer_tenure_days
FROM raw.orders o
JOIN raw.customers c ON o.customer_id = c.customer_id
WHERE o.status != 'cancelled';
That's it. No Stream, no Task, no stored procedure, no scheduling config. Snowflake will keep order_summary within 10 minutes of the source tables. When new rows land in raw.orders or raw.customers, Snowflake detects the change and refreshes the Dynamic Table on the transform_wh warehouse.
Understanding target_lag
The target_lag parameter is the most important configuration on a Dynamic Table. It doesn't set a fixed schedule. It sets a freshness target, which Snowflake describes as best-effort, so applications should not assume the data is always within it. Snowflake's scheduler decides when and how often to refresh, based on how frequently the source data changes and how long each refresh takes.
You can set it as a time interval or use the special keyword DOWNSTREAM:
- Time-based:
TARGET_LAG = '5 minutes','1 hour','1 day'. The minimum is 1 minute. - DOWNSTREAM:
TARGET_LAG = DOWNSTREAM. This means the Dynamic Table only refreshes when a downstream Dynamic Table that depends on it triggers a refresh. Useful for intermediate tables in a chain. If nothing downstream depends on it, a DOWNSTREAM table never refreshes automatically, and Snowflake gives no warning.
A gotcha: setting target_lag = '1 minute' doesn't mean the table refreshes every minute. If a refresh takes 3 minutes to complete, Snowflake will start the next one immediately after the previous finishes, but you'll see actual lag of 3+ minutes. Because target lag is best-effort, monitor the actual lag with:
SELECT *
FROM TABLE(INFORMATION_SCHEMA.DYNAMIC_TABLE_REFRESH_HISTORY(
NAME => 'MY_DB.MY_SCHEMA.ORDER_SUMMARY',
DATA_TIMESTAMP_START => DATEADD('hour', -6, CURRENT_TIMESTAMP())
))
ORDER BY DATA_TIMESTAMP DESC;
REFRESH_MODE: Five Refresh Modes
Dynamic Tables now support five refresh modes, set with the REFRESH_MODE parameter:
- AUTO (default): Snowflake evaluates the definition once, at creation, and resolves it to INCREMENTAL or FULL. It does not re-evaluate later, so if a change makes the query incompatible with incremental refresh, refreshes fail instead of switching to full. Snowflake recommends AUTO for exploration and prototyping.
- INCREMENTAL: processes only the data that changed since the last refresh. Snowflake errors at creation time if the query doesn't support incremental processing.
- FULL: re-executes the whole definition against the current base tables on every refresh. It is needed for constructs such as EXCEPT or PERCENTILE_CONT, and it can be the cheaper choice for small tables.
- ADAPTIVE: generally available since 30 July 2026, it refreshes incrementally by default but reinitializes automatically when an incremental refresh would cost more than a rebuild, for example after an INSERT OVERWRITE or a large bulk delete. Snowflake recommends it as the preferred mode for incremental workloads.
- CUSTOM_INCREMENTAL: generally available since 27 July 2026, it lets you define how changes are applied, with DML such as MERGE in a
REFRESH USINGclause. Snowflake positions it for patterns such as soft deletes, stateful aggregation and migrating existing Streams and Tasks logic.
In production, Snowflake recommends setting ADAPTIVE, FULL or INCREMENTAL explicitly instead of relying on AUTO. To see which mode an existing table uses and why, check the refresh_mode and refresh_mode_reason columns of SHOW DYNAMIC TABLES. In the refresh history, REFRESH_ACTION shows whether each refresh ran as FULL, INCREMENTAL, NO_DATA, REINITIALIZE or CUSTOM_INCREMENTAL. UNION ALL and most window functions support incremental refresh. EXCEPT and INTERSECT do not, and neither do PERCENT_RANK, DENSE_RANK or RANK with sliding window frames.
Want this running in your own account? We build Snowflake platforms end to end: ingestion, modelling, access control, and the monitoring that tells you when a load drifts. Not slide decks. Not roadmaps. Real working systems you can point at.
Book a Snowflake call Snowflake consultingWhen Dynamic Tables Are the Right Choice
Dynamic Tables work best when your pipeline is essentially a chain of SQL transformations and you want Snowflake to handle the scheduling and change tracking. Specific use cases:
- Star schema dimension and fact table refreshes. If you're building a star schema from raw tables, each dimension and fact table can be a Dynamic Table with appropriate lag. Dimensions might have
target_lag = '1 hour'while fact tables use'10 minutes'. - Denormalized reporting tables. The classic "join 5 tables, add computed columns, land it in a flat table for BI" pattern. Dynamic Tables handle this well.
- Multi-hop pipelines where you want declarative dependencies. If Dynamic Table B reads from Dynamic Table A, Snowflake automatically chains the refreshes. You don't need to manage Task dependencies manually.
- Replacing simple dbt models that don't need testing or documentation. If you have dbt models that are purely SQL transformations without custom tests, Dynamic Tables can replace them and give you near-real-time freshness without a scheduler.
When to Stick with Streams/Tasks
Dynamic Tables have real limitations. Here's when you need the Streams/Tasks pattern instead:
- Upserts inside wider procedural logic. Custom incremental dynamic tables, generally available since July 2026, accept MERGE logic in a REFRESH USING clause, which covers many upsert pipelines. When the upsert sits among validation steps, error handling or branching, a Task that runs a MERGE against a Stream is still simpler to reason about.
- External functions. Dynamic Tables cannot call external functions, so calling an ML model endpoint or another external service belongs in a Task. Scalar UDFs are supported: IMMUTABLE UDFs work with incremental refresh, VOLATILE ones only in the SELECT list, and UDTFs in lateral joins force a full refresh.
- Multi-step procedural logic. If your pipeline involves conditional branching (do X if the data looks like this, do Y otherwise), stored procedures called by Tasks are more appropriate.
- Writing to multiple targets from a single change set. A Stream can be consumed by multiple Tasks, each writing to a different target table. Dynamic Tables produce a single output.
- External API calls or notifications. Need to send a webhook or call an API when data changes? That's a Task with a stored procedure, not a Dynamic Table.
Monitoring and Troubleshooting
Dynamic Tables are managed by Snowflake's internal scheduler, which means you don't control exactly when refreshes happen. That's great until something goes wrong. Here's how to stay on top of it:
Check current lag and status:
SHOW DYNAMIC TABLES LIKE 'ORDER_SUMMARY' IN SCHEMA my_db.my_schema; -- Key columns to check: -- SCHEDULING_STATE: RUNNING or SUSPENDED (failed refreshes appear in the refresh history) -- REFRESH_MODE and REFRESH_MODE_REASON: the mode in use and why -- DATA_TIMESTAMP: When the data was last refreshed -- TARGET_LAG: Your configured lag
If a Dynamic Table falls behind: Check whether the warehouse is undersized (refresh takes longer than the target lag), whether the source data volume spiked, or whether there's a resource contention issue from other workloads on the same warehouse. A dedicated warehouse for Dynamic Table refreshes is usually worth the cost on production workloads.
Common Gotchas
- AUTO is decided once. A table created with AUTO keeps the mode it resolved to at creation. If a later change makes the query incompatible with incremental refresh, refreshes fail, which is one reason Snowflake recommends an explicit mode in production.
- External functions are not supported. Scalar UDFs work, within the incremental-refresh limits described above, but pipelines that call external functions need Streams and Tasks.
- Warehouse costs can sneak up. Each Dynamic Table refresh consumes warehouse compute. If you have 50 Dynamic Tables all refreshing every 5 minutes on the same warehouse, the credits add up. Group related tables on dedicated warehouses and set appropriate auto-suspend timeouts.
- Changing the definition. ALTER DYNAMIC TABLE can change
target_lagand the warehouse, but not the query or the refresh mode. CREATE OR ALTER DYNAMIC TABLE is now documented for changing the definition or refresh mode. CREATE OR REPLACE drops and recreates the table, which triggers reinitialization and affects downstream tables, and a frozen region (the feature previously called immutability constraints) can reduce that impact.
Key Takeaways
- Dynamic Tables are the right fit for declarative, SQL-based transformation pipelines where you want Snowflake to manage the refresh schedule.
- Use
target_lagto set freshness requirements, not a fixed schedule. Snowflake treats it as best-effort and schedules refreshes to meet it. - Stick with Streams/Tasks for procedural logic, multiple targets, external functions and API calls. Custom incremental dynamic tables now cover many MERGE-based upserts.
- Monitor with
DYNAMIC_TABLE_REFRESH_HISTORY()andSHOW DYNAMIC TABLES. Don't assume the target lag is always met; check actual performance. - Set
REFRESH_MODEexplicitly in production, usually ADAPTIVE, INCREMENTAL or FULL, and keep AUTO for prototyping.
Related Articles
Frequently Asked Questions
Q: What is a Snowflake Dynamic Table?
A Dynamic Table is a declarative pipeline object in Snowflake that automatically materializes the results of a SQL query and keeps them refreshed based on a target_lag setting. You define the transformation as a SELECT statement and Snowflake handles the refresh scheduling and incremental logic automatically.
Q: What does target_lag mean in Dynamic Tables?
target_lag defines the staleness you're willing to accept. Setting target_lag = '10 minutes' tells Snowflake to keep the table within about 10 minutes of its sources, and its scheduler decides how often to refresh to meet that. Snowflake describes target lag as best-effort, so the table can fall behind when refreshes take longer than the target.
Q: Can Dynamic Tables replace dbt models?
They can replace some dbt models, specifically simple transformations that don't need Jinja logic, custom tests or documentation. Many teams use both: Dynamic Tables for near-real-time materialization and dbt for governed, tested transformations with version control and CI/CD.
Q: What are the limitations of Snowflake Dynamic Tables?
Dynamic Tables can't call external functions or stored procedures in their defining query, and they don't read from external tables or stages directly. Scalar UDFs are supported with some limits on incremental refresh, and custom incremental dynamic tables accept MERGE logic. For procedural steps, several targets or external calls, use Streams and Tasks.
