Store Procedure to Rename certain objects in SQL Server
The SP_RENAME system store procedure can be emulated in Snowflake in certain scenarios. In general, the equivalent is the EXECUTE IMMEDIATE using a dynamic statement with the ALTER TABLE and the original parameters.
Translation Examples for Tables
Source
IN -> SqlServer_01.sql
EXEC sp_rename 'TABLE1', 'TABLENEW1'
Output
OUT -> SqlServer_01.sql
EXECUTEIMMEDIATE'ALTER TABLE TABLE1 RENAME TO TABLENEW1';