VARIABLES view

This Information Schema view displays a row for each schema variable defined in the specified (or current) database.

Columns

Column NameData TypeDescription
VARIABLE_CATALOGVARCHARDatabase that the variable belongs to
VARIABLE_SCHEMAVARCHARSchema that the variable belongs to
VARIABLE_NAMEVARCHARName of the variable
VARIABLE_OWNERVARCHARName of the role that owns the variable
DATA_TYPEVARCHARDeclared data type of the variable
VALUEVARCHARCurrent value of the variable, or NULL if no value has been set
DEFAULT_VALUEVARCHARDefault value of the variable, or NULL if no default was declared
VERSIONNUMBERMonotonically increasing version number; incremented each time the variable is set
CREATEDTIMESTAMP_LTZCreation time of the variable
LAST_ALTEREDTIMESTAMP_LTZDate and time the variable was last altered. See Usage Notes.
COMMENTVARCHARComment for the variable

Usage notes

  • The view only displays variables for which the current role has been granted OWNERSHIP, READ, or WRITE privilege. The view does not honor the MANAGE GRANTS privilege and may show less information than SHOW SCHEMA VARIABLES IN SCHEMA when executed by a user who holds the MANAGE GRANTS privilege.
  • The LAST_ALTERED column is updated when the following operations are performed on an object:

    • DDL operations.
    • DML operations (for tables only). This column is updated even when no rows are affected by the DML statement.
    • Background maintenance operations on metadata performed by Snowflake.