SP_RENAME

Store Procedure to Rename certain objects in SQL Server

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Applies to

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
EXECUTE IMMEDIATE 'ALTER TABLE TABLE1 RENAME TO TABLENEW1';

Source

IN -> SqlServer_02.sql
DECLARE @varname1 nvarchar(50) = 'previous_name'
DECLARE @varname2 nvarchar(50) = 'newer_name'
EXEC sp_rename @varname1, @varname2

Output

Translation Examples for Columns

Source

Output

Source

Output

  1. SSC-EWI-TS0075: Translation for Built-In Procedure Is Not Currently Supported.

Last updated