20 October 2018 · Ryan-Dallas ·       Add to Favorites   Report

CREATE TABLE CLONE Statement in Snowflake

Cloning creates a new table in snowflake (The underlying data is not copied over or duplicated) If you make any changes to the new table, the original table is unaffected by those changes.

Example:

create table mytable_copy CLONE mytable;

Creates a new table with the same column definitions and containing all the existing data from the source table, without actually copying the data.

Syntax:

CREATE [ OR REPLACE ] TABLE <name> CLONE <source_table>
[ { AT | BEFORE } { TIMESTAMP => <timestamp> | OFFSET => <time_difference> | STATEMENT => <id> } ]
[ COPY GRANTS ]


Also, See:

Ryan-Dallas

posted on 20 October 2018

Read great educational content like this and a lot more !

Members get free exclusive access to content, new courses, and discounts. Signup for a free account to write a post / comment / upvote posts. Creating an account takes less than 5 seconds and you can start earning badges & points too

Copied