How to execute a script with the below steps in Snowflake:
1.) check the environment if dev, qa, sit, prod using account url, current_account function. 2.) if the current_account is qa.snowflakcomputig.com then 3.) check if there is a table named TABLEA 4.) if YES, then rename table to TABLEB
I want to achieve this using Snowflake SQL. I know we cannot write anonymous block, could this be achieved using just SQL, session variables and any new rich functions that snowflake might provide.