CURRENT_SCHEMA | Snowflake Documentation (original) (raw)

Categories:

Context functions (Session Object)

Returns the name of the current schema, which varies depending on where you call the function:

Syntax

Arguments

None.

Usage notes

Examples

Show the current warehouse, database, and schema:

SELECT CURRENT_WAREHOUSE(), CURRENT_DATABASE(), CURRENT_SCHEMA();

Output:

+---------------------+--------------------+------------------+ | CURRENT_WAREHOUSE() | CURRENT_DATABASE() | CURRENT_SCHEMA() | |---------------------+--------------------+------------------| | DEV_WAREHOUSE | TEST_DATABASE | UDF_TEST_SCHEMA | +---------------------+--------------------+------------------+