Snowflake Vs MS-SQL - Part 43 - Swap Tables

          


Swap Tables

Suppose you have table Main_table, if you want to do a lot of business logic on existing data for temporary purposes, which needs approval before committing.  Hence you create another table Main_Table_Staging from table Main_Table. Once you receive the approval, you must replace this table Main_Table_Staging with the existing table Main_Table.

In this case, you need to swap both tables.

MS-SQL Server 

You need to perform multiple steps using SP_RENAME.



In Snowflake, we can use a similar approach as above.



However, Snowflake has a different operation SWAP.



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




Yogesh Shinde

LinkedInProfile

<<< Back Next >>>

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