Account & Session DDL

The following DDL commands are used to view and manage account-level and session operations, including:

  • Viewing parameters at multiple levels in the system (account, session, object).

  • Setting parameters at the account-level and within a session.

  • Using a role, warehouse, database, or schema within a session.

  • Using multi-statement transactions within a session.

  • Setting and using SQL variables within a session.

Account Parameters & Functions

ALTER ACCOUNT

For setting parameters at the account-level; can only be performed by users with the ACCOUNTADMIN role.

SHOW FUNCTIONS

Displays system-defined functions, as well as any user-defined functions.

SHOW PARAMETERS

For viewing parameter settings for the account.

Managed Accounts

CREATE MANAGED ACCOUNT

Currently used to create reader accounts for providers who wish to share data with non-Snowflake customers.

DROP MANAGED ACCOUNT

SHOW MANAGED ACCOUNTS

Global Accounts, Replication and Failover/Failback

ALTER CONNECTION

CREATE ACCOUNT

Used to create accounts in an organization.

CREATE CONNECTION

DROP ACCOUNT

DROP CONNECTION

SHOW CONNECTIONS

SHOW GLOBAL ACCOUNTS

Deprecated. Use SHOW REPLICATION ACCOUNTS instead.

SHOW REPLICATION ACCOUNTS

SHOW REPLICATION DATABASES

SHOW REGIONS

UNDROP ACCOUNT

Session Parameters

ALTER SESSION

For setting parameters within a session; can be performed by any user.

SHOW PARAMETERS

For viewing parameter settings for the session (or account); can also be used to view parameter settings for a specified object.

Session Context

USE ROLE

Specifies the primary role to use in the session.

USE SECONDARY ROLES

Specifies the secondary roles to use in the session.

USE WAREHOUSE

Specifies the virtual warehouse to use in the session.

USE DATABASE

Specifies the database to use in the session.

USE SCHEMA

Specifies the schema to use in the session (specified schema must be in the current database for the session).

See also:

Context Functions

Queries

DESCRIBE RESULT

Describes the columns in the results from a specified query (must have been executed within the last 24 hours).

SHOW LOCKS

For use with multi-statement transactions.

Session Transactions

BEGIN

For use with multi-statement transactions.

COMMIT

For use with multi-statement transactions.

DESCRIBE TRANSACTION

Describes the state of the transaction (e.g. committed, rolled back, running), etc.

ROLLBACK

For use with multi-statement transactions.

SHOW TRANSACTIONS

Lists all running transactions.

SQL Variables

SET

For defining SQL variables in the session.

SHOW VARIABLES

For showing SQL variables in the session.

UNSET

For dropping SQL variables in the session.