sqlsnowflake-cloud-data-platform

SHOW PARAMETERS All level in single query


We can check parameters of SESSION/ACCOUNT/DATABASE level individually using SHOW command in Snowflake:

SHOW PARAMETERS IN ACCOUNT;   —- shows parameters defined at the user level
SHOW PARAMETERS IN USER;      –- shows parameters defined at the session level
SHOW PARAMETERS IN SESSION;   -– shows parameters defined at the session level

Is there any common view to list everything at once in Snowflake?


Solution

  • It is possible to union all them using flow operator ->>:

    SHOW PARAMETERS IN ACCOUNT
    ->>
    SHOW PARAMETERS IN USER
    ->>
    SHOW PARAMETERS IN SESSION
    ->>
    SELECT 'Session' AS lvl, * FROM $1
    UNION ALL BY NAME
    SELECT 'User'    AS lvl, * FROM $2
    UNION ALL BY NAME 
    SELECT 'Account' AS lvl, * FROM $3;
    

    Output:

    enter image description here