TRUNCATE MATERIALIZED VIEW

statementsupportedTables, views, streams, sequencesEnterprise+decommissioned

docs.snowflake.com ↗

Removes all rows from a materialized view, but leaves the view intact (including all privileges and constraints on the materialized view). Note that this is different from DROP MATERIALIZED VIEW, which removes the materialized view from the system. Snowflake no longer supports truncation of materialized views. If you have an existing materialized view that you want to truncate, but not drop, the closest alternative is: CREATE OR REPLACE MATERIALIZED VIEW <name> COPY GRANTS ... The CREATE OR REPLACE MATERIALIZED VIEW command executes as a foreground statement and requires a warehouse. Materialized views require Enterprise Edition. To inquire about upgrading, please contact Snowflake Support.

Syntax

TRUNCATE MATERIALIZED VIEW <name>

Parameters

NameRequiredDescription
nameSpecifies the identifier for the materialized view to truncate. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive (e.g. "My Object"). If the materialized view identifier is not fully-qualified (in the form of db_name.schema_name.materialized_view_name or schema_name.materialized_view_name), then the command looks for the materialized view in the current schema for the session.

Usage notes

See also