All Commands (Alphabetical)

This topic provides a list of all DDL and DML commands, as well as the SELECT command and other related commands, in alphabetical order.

Command Name

Summary

A

ALTER <object>

Modifies the metadata of an account-level or database object, or the parameters for a session.

ALTER ACCOUNT

Modifies an account.

ALTER API INTEGRATION

Modifies the properties of an existing API integration.

ALTER CONNECTION

Modifies the properties for an existing connection.

ALTER DATABASE

Modifies the properties for an existing database.

ALTER DATABASE ROLE

Modifies the properties for an existing database role.

ALTER EXTERNAL TABLE

Modifies the properties, columns, or constraints for an existing external table.

ALTER FAILOVER GROUP

Modifies the properties for an existing failover group.

ALTER FILE FORMAT

Modifies the properties for an existing file format object.

ALTER FUNCTION

Modifies the properties of an existing user-defined or external function.

ALTER INTEGRATION

Modifies the properties for an existing integration.

ALTER MASKING POLICY

Replaces the existing masking policy rules with new rules or a new comment and allows the renaming of a masking policy.

ALTER MATERIALIZED VIEW

Alters a materialized view in the current/specified schema.

ALTER NETWORK POLICY

Modifies the properties for an existing network policy.

ALTER NOTIFICATION INTEGRATION

Modifies the properties for an existing notification integration.

ALTER PASSWORD POLICY

Modifies the properties for an existing password policy.

ALTER PIPE

Modifies a limited set of properties for an existing pipe object.

ALTER PROCEDURE

Modifies the properties for an existing stored procedure.

ALTER REPLICATION GROUP

Modifies the properties for an existing replication group.

ALTER RESOURCE MONITOR

Modifies the properties and triggers for an existing resource monitor.

ALTER ROLE

Modifies the properties for an existing custom role.

ALTER ROW ACCESS POLICY

Modifies the properties for an existing row access policy, including renaming the policy or replacing the policy rules.

ALTER SCHEMA

Modifies the properties for an existing schema, including renaming the schema or swapping it with another schema, and changing the Time Travel data retention period (if you are using Snowflake Enterprise Edition or higher).

ALTER SECURITY INTEGRATION

Modifies the properties for an existing security integration.

ALTER SECURITY INTEGRATION (External OAuth)

Modifies the properties of an existing security integration created for External OAuth.

ALTER SECURITY INTEGRATION (Snowflake OAuth)

Modifies the properties of an existing security integration created for a Snowflake OAuth client.

ALTER SECURITY INTEGRATION (SAML2)

Modifies the properties of an existing SAML2 security integration.

ALTER SECURITY INTEGRATION (SCIM)

Modifies the properties of an existing SCIM security integration.

ALTER SEQUENCE

Modifies the properties for an existing sequence.

ALTER SESSION

Sets parameters that change the behavior for the current session.

ALTER SESSION POLICY

Modifies the properties for an existing session policy.

ALTER SHARE

Modifies the properties for an existing share.

ALTER STAGE

Modifies the properties for an existing named internal or external stage.

ALTER STORAGE INTEGRATION

Modifies the properties for an existing storage integration.

ALTER STREAM

Modifies the properties, columns, or constraints for an existing stream.

ALTER TABLE

Modifies the properties, columns, or constraints for an existing table.

ALTER TABLE … ALTER COLUMN

This topic describes how to modify one or more column properties for a table using an ALTER COLUMN clause in a ALTER TABLE statement.

ALTER TAG

Modifies the properties for an existing tag, including renaming the tag and setting a masking policy on a tag.

ALTER TASK

Modifies the properties for an existing task.

ALTER USER

Modifies the properties and object/session parameters for an existing user in the system.

ALTER VIEW

Modifies the properties for an existing view.

ALTER WAREHOUSE

Suspends or resumes a virtual warehouse, or aborts all queries (and other SQL statements) for a warehouse.

B

BEGIN

Begins a transaction in the current session.

C

CALL

Calls a stored procedure.

CALL (with Anonymous Procedure)

Creates and calls an anonymous procedure that is like a stored procedure but is not stored for later use.

COMMENT

Adds a comment or overwrites an existing comment for an existing object.

COMMIT

Commits an open transaction in the current session.

COPY INTO <location>

Unloads data from a table (or query) into one or more files in one of the following locations.

COPY INTO <table>

Loads data from staged files to an existing table.

CREATE <object>

Creates a new object of the specified type.

CREATE ACCOUNT

Creates a new account in your organization.

CREATE API INTEGRATION

Creates a new API integration object in the account, or replaces an existing API integration.

CREATE <object> … CLONE

Creates a copy of an existing object in the system.

CREATE CONNECTION

Creates a new connection in the account.

CREATE DATABASE

Creates a new database in the system.

CREATE DATABASE ROLE

Create a new database role or replace an existing database role in the system.

CREATE EXTERNAL FUNCTION

Creates a new external function.

CREATE EXTERNAL TABLE

Creates a new external table in the current/specified schema or replaces an existing external table.

CREATE FAILOVER GROUP

Creates a new failover group of specified objects in the system.

CREATE FILE FORMAT

Creates a named file format that describes a set of staged data to access or load into Snowflake tables.

CREATE FUNCTION

Creates a new UDF (user-defined function).

CREATE INTEGRATION

Creates a new integration in the system or replaces an existing integration.

CREATE MANAGED ACCOUNT

Creates a new managed account.

CREATE MASKING POLICY

Creates a new masking policy in the current/specified schema or replaces an existing masking policy.

CREATE MATERIALIZED VIEW

Creates a new materialized view in the current/specified schema, based on a query of an existing table, and populates the view with data.

CREATE NETWORK POLICY

Creates a network policy.

CREATE NOTIFICATION INTEGRATION

Creates a new notification integration in the account or replaces an existing integration.

CREATE PASSWORD POLICY

Creates a new password policy or replaces an existing password policy.

CREATE PIPE

Creates a new pipe in the system for defining the COPY INTO <table> statement used by Snowpipe to load data from an ingestion queue into tables.

CREATE PROCEDURE

Creates a new stored procedure.

CREATE REPLICATION GROUP

Creates a new replication group of specified objects in the system.

CREATE RESOURCE MONITOR

Creates a new resource monitor.

CREATE ROLE

Create a new role or replace an existing role in the system.

CREATE ROW ACCESS POLICY

Creates a new row access policy in the current/specified schema or replaces an existing row access policy.

CREATE SCHEMA

Creates a new schema in the current database.

CREATE SECURITY INTEGRATION

Creates a new security integration in the account or replaces an existing integration.

CREATE SECURITY INTEGRATION (External OAuth)

Creates a new External OAuth security integration in the account or replaces an existing integration.

CREATE SECURITY INTEGRATION (Snowflake OAuth)

Creates a new Snowflake OAuth security integration in the account or replaces an existing integration.

CREATE SECURITY INTEGRATION (SAML2)

Creates a new SAML2 security integration in the account or replaces an existing integration.

CREATE SECURITY INTEGRATION (SCIM)

Creates a new SCIM security integration in the account or replaces an existing integration.

CREATE SEQUENCE

Creates a new sequence, which can be used for generating sequential, unique numbers.

CREATE SESSION POLICY

Creates a new session policy or replaces an existing session policy.

CREATE SHARE

Creates a new, empty share.

CREATE STAGE

Creates a new named internal or external stage to use for loading data from files into Snowflake tables and unloading data from tables into files.

CREATE STORAGE INTEGRATION

Creates a new storage integration in the account or replaces an existing integration.

CREATE STREAM

Creates a new stream in the current/specified schema or replaces an existing stream.

CREATE TABLE

Creates a new table in the current/specified schema or replaces an existing table.

CREATE | ALTER TABLE … CONSTRAINT

This topic describes how to create constraints by specifying a CONSTRAINT clause in a CREATE TABLE or ALTER TABLE statement.

CREATE TAG

Creates a new tag or replaces an existing tag in the system.

CREATE TASK

Creates a new task in the current/specified schema or replaces an existing task.

CREATE USER

Creates a new user or replaces an existing user in the system.

CREATE VIEW

Creates a new view in the current/specified schema, based on a query of one or more existing tables (or any other valid query expression).

CREATE WAREHOUSE

Creates a new virtual warehouse in the system.

D

DELETE

Remove rows from a table.

DESCRIBE <object>

Describes the details for the specified object.

DESCRIBE DATABASE

Describes the database.

DESCRIBE EXTERNAL TABLE

Describes the VALUE column and virtual columns in an external table.

DESCRIBE FILE FORMAT

Describes the properties and their current values for a file format, as well as the default values for each property.

DESCRIBE FUNCTION

Describes the specified user-defined function (UDF) or external function, including the signature (i.e. arguments), return value, language, and body (i.e. definition).

DESCRIBE INTEGRATION

Describes the properties of an integration.

DESCRIBE MASKING POLICY

Describes the details about a masking policy, including the creation date, name, data type, and SQL expression.

DESCRIBE MATERIALIZED VIEW

Describes the columns in a materialized view.

DESCRIBE NETWORK POLICY

Describes the properties specified for a network policy.

DESCRIBE PASSWORD POLICY

Describes the details about a password policy.

DESCRIBE PIPE

Describes the properties specified for a pipe, as well as the default values of the properties.

DESCRIBE PROCEDURE

Describes the specified stored procedure, including the stored procedure’s signature (i.e. arguments), return value, language, and body (i.e. definition).

DESCRIBE RESULT

Describes the columns in the result of a query.

DESCRIBE ROW ACCESS POLICY

Describes a row access policy, including the creation date, name, data type, and SQL expression.

DESCRIBE SCHEMA

Describes the schema.

DESCRIBE SEARCH OPTIMIZATION

Describes the search optimization configuration for a specified table and its columns.

DESCRIBE SEQUENCE

Describes a sequence, including the sequence’s interval.

DESCRIBE SESSION POLICY

Describes the details about a session policy.

DESCRIBE SHARE

Describes the data objects that are included in a share.

DESCRIBE STAGE

Describes the values specified for the properties in a stage (file format, copy, and location), as well as the default values for each property.

DESCRIBE STREAM

Describes the columns in a stream.

DESCRIBE TABLE

Describes either the columns in a table or the current values, as well as the default values, for the stage properties for a table.

DESCRIBE TASK

Describes the columns in a task.

DESCRIBE TRANSACTION

Describes the transaction, including the start time and the state (running, committed, rolled back).

DESCRIBE USER

Describes a user, including the current values for the user’s properties, as well as the default values.

DESCRIBE VIEW

Describes the columns in a view (or table).

DESCRIBE WAREHOUSE

Describes the warehouse.

DROP <object>

Removes the specified object from the system.

DROP CONNECTION

Removes a connection from the account.

DROP DATABASE

Removes a database from the system.

DROP DATABASE ROLE

Removes the specified database role from the system.

DROP EXTERNAL TABLE

Removes an external table from the current/specified schema.

DROP FAILOVER GROUP

Removes a failover group from the account.

DROP FILE FORMAT

Removes the specified file format from the current/specified schema.

DROP FUNCTION

Removes the specified user-defined function (UDF) or external function from the current/specified schema.

DROP INTEGRATION

Removes an integration from the account.

DROP MANAGED ACCOUNT

Removes a managed account, including all objects created in the account, and immediately restricts access to the account.

DROP MASKING POLICY

Removes a masking policy from the system.

DROP MATERIALIZED VIEW

Removes the specified materialized view from the current/specified schema.

DROP NETWORK POLICY

Removes the specified network policy from the system.

DROP PASSWORD POLICY

Removes a password policy from the system.

DROP PIPE

Removes the specified pipe from the current/specified schema.

DROP PROCEDURE

Removes the specified stored procedure from the current/specified schema.

DROP REPLICATION GROUP

Removes a replication group from the account.

DROP RESOURCE MONITOR

Removes the specified resource monitor from the system.

DROP ROLE

Removes the specified role from the system.

DROP ROW ACCESS POLICY

Removes a row access policy from the system.

DROP SCHEMA

Removes a schema from the current/specified database.

DROP SEQUENCE

Removes a sequence from the current/specified schema.

DROP SESSION POLICY

Removes a session policy from the system.

DROP SHARE

Removes the specified share from the system and immediately revokes access for all consumers (i.e. accounts who have created a database from the share).

DROP STAGE

Removes the specified named internal or external stage from the current/specified schema.

DROP STREAM

Removes a stream from the current/specified schema.

DROP TABLE

Removes a table from the current/specified schema, but retains a version of the table so that it can be recovered using UNDROP TABLE.

DROP TAG

Removes a tag from the system.

DROP TASK

Removes a task from the current/specified schema.

DROP USER

Removes the specified user from the system.

DROP VIEW

Removes the specified view from the current/specified schema.

DROP WAREHOUSE

Removes the specified virtual warehouse from the system.

E

EXECUTE IMMEDIATE

Executes a string that contains a SQL statement or a Snowflake Scripting statement.

EXECUTE TASK

Manually triggers an asynchronous single run of a scheduled task (either a standalone task or the root task in a DAG (directed acyclic graph) of tasks) independent of the schedule defined for the task.

EXPLAIN

Returns the logical execution plan for the specified SQL statement.

G

GET

Downloads data files from one of the following Snowflake stages to a local directory/folder on a client machine.

GRANT DATABASE ROLE

Assigns a database role to an account role or another database role.

GRANT DATABASE ROLE … TO SHARE

Grants a database role to a share.

GRANT OWNERSHIP

Transfers ownership of an object (or all objects of a specified type in a schema) from one role to another role.

GRANT <privileges>

Grants one or more access privileges on a securable object to a role or database role.

GRANT <privilege> … TO SHARE

Grants access privileges for databases and other supported database objects (schemas, UDFs, tables, and views) to a share.

GRANT ROLE

Assigns a role to a user or another role.

I

INSERT

Updates a table by inserting one or more rows into the table.

INSERT (multi-table)

Updates multiple tables by inserting one or more rows with column values (from a query) into the tables.

L

LIST

Returns a list of files that have been staged (i.e. uploaded from a local file system or unloaded from a table) in one of the following Snowflake stages.

M

MERGE

Inserts, updates, and deletes values in a table based on values in a second table or a subquery.

P

PUT

Uploads (i.e. stages) data files from a local directory/folder on a client machine to one of the following Snowflake stages.

R

REMOVE

Removes files from either an external (external cloud storage) or internal (i.e. Snowflake) stage.

REVOKE DATABASE ROLE

Revokes a database role from an account role or another database role.

REVOKE DATABASE ROLE … FROM SHARE

Revokes a database role from a share.

REVOKE <privileges>

Removes one or more privileges on a securable object from a role or database role.

REVOKE <privilege> … FROM SHARE

Revokes access privileges for databases and other supported database objects (schemas, tables, and views) from a share.

REVOKE ROLE

Removes a role from another role or a user.

ROLLBACK

Rolls back an open transaction in the current session.

S

SELECT

SELECT can be used as either a statement or as a clause within other statements.

SET

Initializes the value of a session variable to the result of a SQL expression.

SHOW <objects>

Lists the existing objects for the specified object type.

SHOW COLUMNS

Lists the columns in the tables or views for which you have access privileges.

SHOW CONNECTIONS

Lists the connections for which you have access privileges.

SHOW DATABASE ROLES

Lists all the database roles in a specified database.

SHOW DATABASES

Lists the databases for which you have access privileges across your entire account, including dropped databases that are still within the Time Travel retention period and, therefore, can be undropped.

SHOW DATABASES IN FAILOVER GROUP

Lists databases in a failover group.

SHOW DATABASES IN REPLICATION GROUP

Lists databases in a replication group.

SHOW DELEGATED AUTHORIZATIONS

Lists the active delegated authorizations for which you have access privileges.

SHOW EXTERNAL FUNCTIONS

Lists all the external functions created for your account.

SHOW EXTERNAL TABLES

Lists the external tables for which you have access privileges.

SHOW FAILOVER GROUPS

Lists the primary and secondary failover groups in your account, as well as the failover groups in other accounts associated with your account.

SHOW FILE FORMATS

Lists the file formats for which you have access privileges.

SHOW FUNCTIONS

Lists all the native (i.e. system-defined/built-in) scalar functions provided by Snowflake, as well as any user-defined functions (UDFs) or external functions that have been created for your account.

SHOW GLOBAL ACCOUNTS

Lists all the accounts in your organization that are enabled for replication and indicates the Snowflake Region in which each account is located.

SHOW GRANTS

Lists all access control privileges that have been explicitly granted to roles, users, and shares.

SHOW INTEGRATIONS

Lists the integrations in your account.

SHOW LOCKS

Lists all running transactions that have locks on resources.

SHOW MANAGED ACCOUNTS

Lists the managed accounts created for your account.

SHOW MASKING POLICIES

Lists masking policy information, including the creation date, database and schema names, owner, and any available comments.

SHOW MATERIALIZED VIEWS

Lists the materialized views that you have privileges to access.

SHOW NETWORK POLICIES

Lists all network policies defined in the system.

SHOW OBJECTS

Lists the tables and views for which you have access privileges.

SHOW ORGANIZATION ACCOUNTS

Lists all the accounts in your organization, excluding managed accounts.

SHOW PARAMETERS

Lists all the account, session, and object parameters that can be set, as well as the current and default values for each parameter.

SHOW PASSWORD POLICIES

Lists password policy information, including the creation date, database and schema names, owner, and any available comments.

SHOW PIPES

Lists the pipes for which you have access privileges.

SHOW PRIMARY KEYS

Lists primary keys for the specified table, or for all tables in the current or specified schema, or for all tables in the current or specified database, or for all tables in the current account.

SHOW PROCEDURES

Lists the stored procedures that you have privileges to access.

SHOW REGIONS

Lists all the regions in which accounts can be created.

SHOW REPLICATION ACCOUNTS

Lists all the accounts in your organization that are enabled for replication and indicates the region in which each account is located.

SHOW REPLICATION DATABASES

Lists all the primary and secondary databases (i.e. all databases for which replication has been enabled) in your organization and indicates the region in which each account is located.

SHOW REPLICATION GROUPS

  • Lists each primary or secondary replication or failover group in this account.

SHOW RESOURCE MONITORS

Lists all the resource monitors in your account for which you have access privileges.

SHOW ROLES

Lists all the roles which you can view across your entire account, including the system-defined roles and any custom roles that exist.

SHOW ROW ACCESS POLICIES

Lists the row access policies for which you have access privileges.

SHOW SCHEMAS

Lists the schemas for which you have access privileges, including dropped schemas that are still within the Time Travel retention period and, therefore, can be undropped.

SHOW SEQUENCES

Lists all the sequences for which you have access privileges.

SHOW SESSION POLICIES

Lists session policy information, including the creation date, database and schema names, owner, and any available comments.

SHOW SHARES

Lists all shares available in the system.

SHOW SHARES IN FAILOVER GROUP

Lists shares in a failover group.

SHOW SHARES IN REPLICATION GROUP

Lists shares in a replication group.

SHOW STAGES

Lists all the stages for which you have access privileges.

SHOW STREAMS

Lists the streams for which you have access privileges.

SHOW TABLES

Lists the tables for which you have access privileges, including dropped tables that are still within the Time Travel retention period and, therefore, can be undropped.

SHOW TAGS

Lists the tag information.

SHOW TASKS

Lists the tasks for which you have access privileges.

SHOW TRANSACTIONS

List all running transactions.

SHOW USER FUNCTIONS

Lists all user-defined functions (UDFs) for which you have access privileges.

SHOW USERS

Lists all users in the system.

SHOW VARIABLES

Lists all variables defined in the current session.

SHOW VIEWS

Lists the views, including secure views, for which you have access privileges.

SHOW WAREHOUSES

Lists all the warehouses in your account for which you have access privileges.

T

TRUNCATE MATERIALIZED VIEW

Removes all rows from a materialized view, but leaves the view intact (including all privileges and constraints on the materialized view).

TRUNCATE TABLE

Removes all rows from a table but leaves the table intact (including all privileges and constraints on the table).

U

UNDROP <object>

Restores the specified object to the system.

UNDROP DATABASE

Restores the most recent version of a dropped database.

UNDROP SCHEMA

Restore the most recent version of a dropped schema.

UNDROP TABLE

Restores the most recent version of a dropped table.

UNDROP TAG

Restores the most recent version of a tag to the system.

UNSET

Drops a session variable.

UPDATE

Updates specified rows in the target table with new values.

USE <object>

Specifies the role, warehouse, database, or schema to use for the current session.

USE DATABASE

Specifies the active/current database for the session.

USE ROLE

Specifies the active/current primary role for the session.

USE SCHEMA

Specifies the active/current schema for the session.

USE SECONDARY ROLES

Specifies the active/current secondary roles for the session.

USE WAREHOUSE

Specifies the active/current warehouse for the session.

Back to top