SSC-FDM-TS0006

EXECUTE AS 'user_name' clause does not exist in Snowflake and the user calling the procedure should have all the required privileges.

Description

This message is shown when SnowConvert finds a procedure with an EXECUTE AS 'user_name' clause. This is not supported in Snowflake, so it is changed EXECUTE AS CALLER.

This clause specifies the security context under which to execute the procedure.

For more details see the documentation about the clause functionality.

Code Example

Input Code:

IN -> SqlServer_01.sql
CREATE PROCEDURE SelectAllCustomers
WITH EXECUTE AS 'user_name'
AS
BEGIN
      SELECT * FROM Customers;
END;

Output Code:

OUT -> SqlServer_01.sql
--** SSC-FDM-0007 - MISSING DEPENDENT OBJECT "Customers" **
CREATE OR REPLACE PROCEDURE SelectAllCustomers ()
RETURNS TABLE()
LANGUAGE SQL
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"transact"}}'
EXECUTE AS CALLER
--** SSC-FDM-TS0006 - EXECUTE AS 'user_name' CLAUSE DOES NOT EXIST IN SNOWFLAKE AND THE USER CALLING THE PROCEDURE SHOULD HAVE ALL THE REQUIRED PRIVILEGES **
AS
$$
      DECLARE
            ProcedureResultSet RESULTSET;
      BEGIN
            ProcedureResultSet := (
            SELECT
                  *
            FROM
                  Customers);
            RETURN TABLE(ProcedureResultSet);
      END;
$$;

Recommendations

Last updated