snowflake-cloud-data-platformsnowflake-schema

Create tables from existing tables without copying data in snowflake


I would like to create tables from existing tables without copying the data to the new tables in snowflake. Is this possible?

For example:

I have tables say "DB"."SCHEMA"."tb1" and "DB"."SCHEMA"."tb2".

I would like to create tables "DB"."SCHEMA"."tb3" and "DB"."SCHEMA"."tb4" from "DB"."SCHEMA"."tb1" and "DB"."SCHEMA"."tb2" without copying their data to "DB"."SCHEMA"."tb3" and "DB"."SCHEMA"."tb4".

Kindly help.

Thanks in advance.


Solution

  • The answer for above question is as below:

    CREATE TABLE "DB"."SCHEMA"."tb3" LIKE "DB"."SCHEMA"."tb1"
    
    CREATE TABLE "DB"."SCHEMA"."tb4" LIKE "DB"."SCHEMA"."tb2"