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.
Yogesh Shinde
Comments
Post a Comment