- Connecting to Snowflake
- Loading Data into Snowflake
- Unloading Data from Snowflake
- Using Snowflake
- Sharing Data Securely in Snowflake
- Managing Your Snowflake Organization
- Managing Your Snowflake Account
- Managing Security in Snowflake
- Managing Governance in Snowflake
- Managing Cost in Snowflake
- General Reference
- SQL Command Reference
- Summary of Commands
- All Commands (Alphabetical)
- ALTER <object>
- ALTER ACCOUNT
- ALTER API INTEGRATION
- ALTER CONNECTION
- ALTER DATABASE
- ALTER DATABASE ROLE
- ALTER EXTERNAL FUNCTION
- ALTER EXTERNAL TABLE
- ALTER FAILOVER GROUP
- ALTER FILE FORMAT
- ALTER FUNCTION
- ALTER INTEGRATION
- ALTER MASKING POLICY
- ALTER MATERIALIZED VIEW
- ALTER NETWORK POLICY
- ALTER NOTIFICATION INTEGRATION
- ALTER PASSWORD POLICY
- ALTER PIPE
- ALTER PROCEDURE
- ALTER REPLICATION GROUP
- ALTER RESOURCE MONITOR
- ALTER ROLE
- ALTER ROW ACCESS POLICY
- ALTER SCHEMA
- ALTER SECURITY INTEGRATION
- ALTER SECURITY INTEGRATION (External OAuth)
- ALTER SECURITY INTEGRATION (Snowflake OAuth)
- ALTER SECURITY INTEGRATION (SAML2)
- ALTER SECURITY INTEGRATION (SCIM)
- ALTER SEQUENCE
- ALTER SESSION
- ALTER SESSION POLICY
- ALTER SHARE
- ALTER STAGE
- ALTER STORAGE INTEGRATION
- ALTER STREAM
- ALTER TABLE
- ALTER TABLE … ALTER COLUMN
- ALTER TAG
- ALTER TASK
- ALTER USER
- ALTER VIEW
- ALTER WAREHOUSE
- BEGIN
- CALL
- CALL (with Anonymous Procedure)
- COMMENT
- COMMIT
- COPY INTO <location>
- COPY INTO <table>
- CREATE <object>
- CREATE ACCOUNT
- CREATE API INTEGRATION
- CREATE <object> … CLONE
- CREATE CONNECTION
- CREATE DATABASE
- CREATE DATABASE ROLE
- CREATE EXTERNAL FUNCTION
- CREATE EXTERNAL TABLE
- CREATE FAILOVER GROUP
- CREATE FILE FORMAT
- CREATE FUNCTION
- CREATE INTEGRATION
- CREATE MANAGED ACCOUNT
- CREATE MASKING POLICY
- CREATE MATERIALIZED VIEW
- CREATE NETWORK POLICY
- CREATE NOTIFICATION INTEGRATION
- CREATE PASSWORD POLICY
- CREATE PIPE
- CREATE PROCEDURE
- CREATE REPLICATION GROUP
- CREATE RESOURCE MONITOR
- CREATE ROLE
- CREATE ROW ACCESS POLICY
- CREATE SCHEMA
- CREATE SECURITY INTEGRATION
- CREATE SECURITY INTEGRATION (External OAuth)
- CREATE SECURITY INTEGRATION (Snowflake OAuth)
- CREATE SECURITY INTEGRATION (SAML2)
- CREATE SECURITY INTEGRATION (SCIM)
- CREATE SEQUENCE
- CREATE SESSION POLICY
- CREATE SHARE
- CREATE STAGE
- CREATE STORAGE INTEGRATION
- CREATE STREAM
- CREATE TABLE
- CREATE | ALTER TABLE … CONSTRAINT
- CREATE TAG
- CREATE TASK
- CREATE USER
- CREATE VIEW
- CREATE WAREHOUSE
- DELETE
- DESCRIBE <object>
- DESCRIBE DATABASE
- DESCRIBE EXTERNAL TABLE
- DESCRIBE FILE FORMAT
- DESCRIBE FUNCTION
- DESCRIBE INTEGRATION
- DESCRIBE MASKING POLICY
- DESCRIBE MATERIALIZED VIEW
- DESCRIBE NETWORK POLICY
- DESCRIBE PASSWORD POLICY
- DESCRIBE PIPE
- DESCRIBE PROCEDURE
- DESCRIBE RESULT
- DESCRIBE ROW ACCESS POLICY
- DESCRIBE SCHEMA
- DESCRIBE SEARCH OPTIMIZATION
- DESCRIBE SEQUENCE
- DESCRIBE SESSION POLICY
- DESCRIBE SHARE
- DESCRIBE STAGE
- DESCRIBE STREAM
- DESCRIBE TABLE
- DESCRIBE TASK
- DESCRIBE TRANSACTION
- DESCRIBE USER
- DESCRIBE VIEW
- DESCRIBE WAREHOUSE
- DROP <object>
- DROP CONNECTION
- DROP DATABASE
- DROP DATABASE ROLE
- DROP EXTERNAL TABLE
- DROP FAILOVER GROUP
- DROP FILE FORMAT
- DROP FUNCTION
- DROP INTEGRATION
- DROP MANAGED ACCOUNT
- DROP MASKING POLICY
- DROP MATERIALIZED VIEW
- DROP NETWORK POLICY
- DROP PASSWORD POLICY
- DROP PIPE
- DROP PROCEDURE
- DROP REPLICATION GROUP
- DROP RESOURCE MONITOR
- DROP ROLE
- DROP ROW ACCESS POLICY
- DROP SCHEMA
- DROP SEQUENCE
- DROP SESSION POLICY
- DROP SHARE
- DROP STAGE
- DROP STREAM
- DROP TABLE
- DROP TAG
- DROP TASK
- DROP USER
- DROP VIEW
- DROP WAREHOUSE
- EXECUTE IMMEDIATE
- EXECUTE TASK
- EXPLAIN
- GET
- GRANT DATABASE ROLE
- GRANT DATABASE ROLE … TO SHARE
- GRANT OWNERSHIP
- GRANT <privileges>
- GRANT <privilege> … TO SHARE
- GRANT ROLE
- INSERT
- INSERT (multi-table)
- LIST
- MERGE
- PUT
- REMOVE
- REVOKE DATABASE ROLE
- REVOKE DATABASE ROLE … FROM SHARE
- REVOKE <privileges>
- REVOKE <privilege> … FROM SHARE
- REVOKE ROLE
- ROLLBACK
- SELECT
- SET
- SHOW <objects>
- SHOW COLUMNS
- SHOW CONNECTIONS
- SHOW DATABASE ROLES
- SHOW DATABASES
- SHOW DATABASES IN FAILOVER GROUP
- SHOW DATABASES IN REPLICATION GROUP
- SHOW DELEGATED AUTHORIZATIONS
- SHOW EXTERNAL FUNCTIONS
- SHOW EXTERNAL TABLES
- SHOW FAILOVER GROUPS
- SHOW FILE FORMATS
- SHOW FUNCTIONS
- SHOW GLOBAL ACCOUNTS
- SHOW GRANTS
- SHOW INTEGRATIONS
- SHOW LOCKS
- SHOW MANAGED ACCOUNTS
- SHOW MASKING POLICIES
- SHOW MATERIALIZED VIEWS
- SHOW NETWORK POLICIES
- SHOW OBJECTS
- SHOW ORGANIZATION ACCOUNTS
- SHOW PARAMETERS
- SHOW PASSWORD POLICIES
- SHOW PIPES
- SHOW PRIMARY KEYS
- SHOW PROCEDURES
- SHOW REGIONS
- SHOW REPLICATION ACCOUNTS
- SHOW REPLICATION DATABASES
- SHOW REPLICATION GROUPS
- SHOW RESOURCE MONITORS
- SHOW ROLES
- SHOW ROW ACCESS POLICIES
- SHOW SCHEMAS
- SHOW SEQUENCES
- SHOW SESSION POLICIES
- SHOW SHARES
- SHOW SHARES IN FAILOVER GROUP
- SHOW SHARES IN REPLICATION GROUP
- SHOW STAGES
- SHOW STREAMS
- SHOW TABLES
- SHOW TAGS
- SHOW TASKS
- SHOW TRANSACTIONS
- SHOW USER FUNCTIONS
- SHOW USERS
- SHOW VARIABLES
- SHOW VIEWS
- SHOW WAREHOUSES
- TRUNCATE MATERIALIZED VIEW
- TRUNCATE TABLE
- UNDROP <object>
- UNDROP DATABASE
- UNDROP SCHEMA
- UNDROP TABLE
- UNDROP TAG
- UNSET
- UPDATE
- USE <object>
- USE DATABASE
- USE ROLE
- USE SCHEMA
- USE SECONDARY ROLES
- USE WAREHOUSE
- DDL (Data Definition Language) Commands
- DML (Data Manipulation Language) Commands
- Query Syntax
- Query Operators
- SQL Function Reference
- Snowflake Scripting Reference
- API Reference
- Appendices
ALTER SHARE¶
Provider sharing not enabled for all accounts
Provider sharing is enabled by default for most, but not all accounts.
If you encounter errors when attempting to share data with consumers, the feature may not be enabled for your account. To inquire about enabling it, please contact Snowflake Support.
Modifies the properties for an existing share:
Adds or removes accounts from the list of accounts.
Sets a new list of accounts with which the corresponding database for the share is shared.
Modifies other properties. For parameter details, see Parameters.
- See also:
Syntax¶
ALTER SHARE [ IF EXISTS ] <name> { ADD | REMOVE } ACCOUNTS = <consumer_account> [ , <consumer_account> , ... ]
[ SHARE_RESTRICTIONS = { TRUE | FALSE } ]
ALTER SHARE [ IF EXISTS ] <name> ADD ACCOUNTS = <consumer_account> [ , <consumer_account> , ... ]
[ SHARE_RESTRICTIONS = { TRUE | FALSE } ]
ALTER SHARE [ IF EXISTS ] <name> SET { [ ACCOUNTS = <consumer_account> [ , <consumer_account> ... ] ]
[ COMMENT = '<string_literal>' ] }
ALTER SHARE [ IF EXISTS ] <name> SET TAG <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' ... ]
ALTER SHARE <name> UNSET TAG <tag_name> [ , <tag_name> ... ]
ALTER SHARE [ IF EXISTS ] <name> UNSET COMMENT
Parameters¶
name
Specifies the identifier for the share to alter. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.
ADD | REMOVE ACCOUNTS = consumer_account [ , consumer_account , ... ]
Specifies the name of the account(s) to add or remove from the list of accounts for the share:
Adding an account to a share that was already in the list has no effect.
Removing an account that has already imported the shared database immediately revokes that account’s access to the database. If the account is later added back to the share, the account must re-create the database before they can use it again.
Removing an account from a share that was not already in the list of shared accounts has no effect.
This parameter adds to (or removes from) the existing list of accounts for the share. If you want to replace the entire list of accounts, use
SET
instead.SHARE_RESTRICTIONS = TRUE | FALSE
Enables/disables adding a Standard or Enterprise consumer account to a share belonging to a Business Critical data provider.
Important
You must set this parameter each time you are adding a new non-Business Critical consumer account to the share belonging to a Business Critical provider. For more information see, Enabling Sharing from a Business Critical Account to a non-Business Critical Account.
SET...
ACCOUNTS = consumer_account [ , consumer_account ... ]
Specifies the account(s) to replace all previous accounts with which the share was shared. To add/remove individual accounts from the list, use
ADD | REMOVE
instead.
TAG tag_name = 'tag_value' [ , tag_name = 'tag_value' , ... ]
Specifies the tag name and the tag string value.
The tag value is always a string, and the maximum number of characters for the tag value is 256.
For details about specifying tags in a statement, see Tag Quotas for Objects & Columns.
COMMENT = 'string'
Adds a comment or overwrites an existing comment for the share.
UNSET ...
Specifies one or more properties/parameters to unset for the share, which resets them back to their defaults:
TAG tag_name [ , tag_name ... ]
COMMENT
Usage Notes¶
One of the following privileges is required to alter a share:
The OWNERSHIP privilege which is granted to the role that creates the share.
The CREATE SHARE privilege. By default, only the ACCOUNTADMIN has the CREATE SHARE privilege. The ACCOUNTADMIN can grant the privilege to any other role. The owner of the share cannot grant this privilege.
Keywords
ACCOUNT
andACCOUNTS
are both supported and can be used interchangeably.Regarding metadata:
Attention
Customers should ensure that no personal data (other than for a User object), sensitive data, export-controlled data, or other regulated data is entered as metadata when using the Snowflake service. For more information, see Metadata Fields in Snowflake.
Examples¶
Add two accounts to the existing share named sales_s
:
ALTER SHARE sales_s ADD ACCOUNTS=<orgname.accountname1>,<orgname.accountname2>; +----------------------------------+ | status | |----------------------------------| | Statement executed successfully. | +----------------------------------+
Remove account <orgname.accountname>;
from sales_s
:
ALTER SHARE sales_s REMOVE ACCOUNT=<orgname.accountname>; +----------------------------------+ | status | |----------------------------------| | Statement executed successfully. | +----------------------------------+
Set a new comment for sales_s
:
ALTER SHARE sales_s SET COMMENT='This share contains sales data for 2017'; +----------------------------------+ | status | |----------------------------------| | Statement executed successfully. | +----------------------------------+