SSC-EWI-TS0080
Changing the execution context at runtime is not supported in Snowflake
Severity
High
Description
Users in SQL Server can use the command EXECUTE AS
to temporarily change the execution context, this modifies the execution privileges and affects the results of context-dependent functions like USER_NAME()
. The REVERT
command can be used to restore the context previous to the last EXECUTE AS
.
Snowflake only supports the definition of an execution context in procedures, using either the CREATE PROCEDURE
or ALTER PROCEDURE
statements. Changing the context at runtime is not supported.
Code Example
Input Code:
IN -> SqlServer_01.sql
Output Code:
OUT -> SqlServer_01.sql
Recommendations
Refactor the code so it works without having to switch the context.
If you need more support, you can email us at snowconvert-support@snowflake.com
Last updated