Like Table

Description

Specifies that the columns of the table have the same name and description as the columns of the specified table.

Grammar Syntax

<like clause> ::=
  LIKE <table name>  [ <like options>  ]
  <like options> ::=
  <like option> ...
<like option> ::=
    <identity option> 
  | <column default option> 
  | <generation option>   
<identity option> ::=
    INCLUDING IDENTITY
  | EXCLUDING IDENTITY
<column default option> ::=
    INCLUDING DEFAULTS
  | EXCLUDING DEFAULTS
<generation option> ::=
    INCLUDING GENERATED
  | EXCLUDING GENERATED

Click here to go to the ANSI SQL Standard specification for this syntax.

LIKE TABLES are partially supported in Snowflake. The like options doesn't not apply in Snowflake

Sample Source Patterns

ANSI SQL Input Code

CREATE TABLE TABLE01
LIKE TABLE02 INCLUDING IDENTITY;

Snowflake Output Code

CREATE TABLE TABLE01
LIKE TABLE02
-- ** MSC-WARNING - MSCEWI1002 - REMOVED NEXT STATEMENT, NOT APPLICABLE IN SNOWFLAKE. LIKE CLAUSE IDENTITY OPTION **
--             INCLUDING IDENTITY
                               ;

Last updated