Snowflake Vs MS-SQL - Part 13 - Create Table


Create Table

When writing the code, you need to create a table on the fly many times. 

MS-SQL Server 

You can use the INTO clause to create a table during run time.



If you want to create an empty table 
i.e. with only structure then you can mention a condition in the where clause that is NOT true as below.




In Snowflake we can achieve this by using the Create or Replace clause. This syntax is called CTAS(Create Table As Select).





To create an empty table i.e. with only structure in Snowflake we can use the LIKE clause as below.



Note: The same applies to the Temporary table.

For more details, you can refer to the following LINK.



Comments

Popular posts from this blog

Snowflake Vs MS-SQL - Part 36 - SPLIT_TO_TABLE

Snowflake Vs MS-SQL - Part 63 - ON Clause & Cross Join

Snowflake Vs MS-SQL - Part 33 - INITCAP