SP_RENAME
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
EXEC sp_rename 'TABLE1', 'TABLENEW1'Output
!!!RESOLVE EWI!!! /*** SSC-EWI-TS0075 - TRANSLATION FOR BUILT-IN PROCEDURE 'sp_rename' IS NOT CURRENTLY SUPPORTED. ***/!!!
EXEC sp_rename 'TABLE1', 'TABLENEW1';Source
DECLARE @varname1 nvarchar(50) = 'previous_name'
DECLARE @varname2 nvarchar(50) = 'newer_name'
EXEC sp_rename @varname1, @varname2Output
DECLARE
VARNAME1 VARCHAR(50) := 'previous_name';
VARNAME2 VARCHAR(50) := 'newer_name';
BEGIN
!!!RESOLVE EWI!!! /*** SSC-EWI-TS0075 - TRANSLATION FOR BUILT-IN PROCEDURE 'sp_rename' IS NOT CURRENTLY SUPPORTED. ***/!!!
EXEC sp_rename :VARNAME1, :VARNAME2;
END;Translation Examples for Columns
Source
Output
Source
Output
Related EWIs
SSC-EWI-TS0075: Translation for Built-In Procedure Is Not Currently Supported.
Last updated