- Connecting to Snowflake
- Loading Data into Snowflake
- Unloading Data from Snowflake
- Using Snowflake
- Sharing Data Securely in Snowflake
- General Reference
- SQL Command Reference
- Summary of Commands
- All Commands (Alphabetical)
- ALTER <object>
- ALTER ACCOUNT
- ALTER API INTEGRATION
- ALTER DATABASE
- ALTER EXTERNAL FUNCTION
- ALTER EXTERNAL TABLE
- ALTER FILE FORMAT
- ALTER FUNCTION
- ALTER INTEGRATION
- ALTER MASKING POLICY
- ALTER MATERIALIZED VIEW
- ALTER NETWORK POLICY
- ALTER NOTIFICATION INTEGRATION
- ALTER PIPE
- ALTER PROCEDURE
- ALTER RESOURCE MONITOR
- ALTER ROLE
- ALTER SCHEMA
- ALTER SECURITY INTEGRATION
- ALTER SEQUENCE
- ALTER SESSION
- ALTER SHARE
- ALTER STAGE
- ALTER STORAGE INTEGRATION
- ALTER STREAM
- ALTER TABLE
- ALTER TABLE … ALTER COLUMN
- ALTER TASK
- ALTER USER
- ALTER VIEW
- ALTER WAREHOUSE
- BEGIN
- CALL
- COMMENT
- COMMIT
- COPY INTO <location>
- COPY INTO <table>
- CREATE <object>
- CREATE ACCOUNT
- CREATE API INTEGRATION
- CREATE <object> … CLONE
- CREATE DATABASE
- CREATE EXTERNAL FUNCTION
- CREATE EXTERNAL TABLE
- CREATE FILE FORMAT
- CREATE FUNCTION
- CREATE INTEGRATION
- CREATE MANAGED ACCOUNT
- CREATE MASKING POLICY
- CREATE MATERIALIZED VIEW
- CREATE NETWORK POLICY
- CREATE NOTIFICATION INTEGRATION
- CREATE PIPE
- CREATE PROCEDURE
- CREATE RESOURCE MONITOR
- CREATE ROLE
- CREATE SCHEMA
- CREATE SECURITY INTEGRATION
- CREATE SEQUENCE
- CREATE SHARE
- CREATE STAGE
- CREATE STORAGE INTEGRATION
- CREATE STREAM
- CREATE TABLE
- CREATE | ALTER TABLE … CONSTRAINT
- CREATE TASK
- CREATE USER
- CREATE VIEW
- CREATE WAREHOUSE
- DELETE
- DESCRIBE <object>
- DESCRIBE EXTERNAL TABLE
- DESCRIBE FILE FORMAT
- DESCRIBE FUNCTION
- DESCRIBE INTEGRATION
- DESCRIBE MASKING POLICY
- DESCRIBE MATERIALIZED VIEW
- DESCRIBE NETWORK POLICY
- DESCRIBE PIPE
- DESCRIBE PROCEDURE
- DESCRIBE RESULT
- DESCRIBE SEQUENCE
- DESCRIBE SHARE
- DESCRIBE STAGE
- DESCRIBE STREAM
- DESCRIBE TABLE
- DESCRIBE TASK
- DESCRIBE USER
- DESCRIBE VIEW
- DROP <object>
- DROP DATABASE
- DROP EXTERNAL TABLE
- DROP FILE FORMAT
- DROP FUNCTION
- DROP INTEGRATION
- DROP MANAGED ACCOUNT
- DROP MASKING POLICY
- DROP MATERIALIZED VIEW
- DROP NETWORK POLICY
- DROP PIPE
- DROP PROCEDURE
- DROP RESOURCE MONITOR
- DROP ROLE
- DROP SCHEMA
- DROP SEQUENCE
- DROP SHARE
- DROP STAGE
- DROP STREAM
- DROP TABLE
- DROP TASK
- DROP USER
- DROP VIEW
- DROP WAREHOUSE
- EXPLAIN
- GET
- GRANT OWNERSHIP
- GRANT <privileges> … TO ROLE
- GRANT <privilege> … TO SHARE
- GRANT ROLE
- INSERT
- INSERT (multi-table)
- LIST
- MERGE
- PUT
- REMOVE
- REVOKE <privileges> … FROM ROLE
- REVOKE <privilege> … FROM SHARE
- REVOKE ROLE
- ROLLBACK
- SELECT
- SET
- SHOW <objects>
- SHOW COLUMNS
- SHOW DATABASES
- SHOW DELEGATED AUTHORIZATIONS
- SHOW EXTERNAL FUNCTIONS
- SHOW EXTERNAL TABLES
- 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 PIPES
- SHOW PROCEDURES
- SHOW REGIONS
- SHOW REPLICATION ACCOUNTS
- SHOW REPLICATION DATABASES
- SHOW RESOURCE MONITORS
- SHOW ROLES
- SHOW SCHEMAS
- SHOW SEQUENCES
- SHOW SHARES
- SHOW STAGES
- SHOW STREAMS
- SHOW TABLES
- SHOW TASKS
- SHOW TRANSACTIONS
- SHOW USER FUNCTIONS
- SHOW USERS
- SHOW VARIABLES
- SHOW VIEWS
- SHOW WAREHOUSES
- TRUNCATE MATERIALIZED VIEW
- TRUNCATE TABLE
- UNDROP DATABASE
- UNDROP SCHEMA
- UNDROP TABLE
- UNSET
- UPDATE
- USE <object>
- USE DATABASE
- USE ROLE
- USE SCHEMA
- USE WAREHOUSE
- DDL Commands
- DML Commands
- Query Syntax
- Query Operators
- SQL Function Reference
- Appendices
- Categories:
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> 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.COMMENT = 'string'
Adds a comment or overwrites an existing comment for the share.
UNSET ...
Specifies the properties to unset for the share, which resets them to the defaults.
Currently, the only property you can unset is
COMMENT
, which removes the comment, if one exists, for the share.
Usage Notes¶
Only the ACCOUNTADMIN role has the privileges to alter a share. Executing this command with any role other than ACCOUNTADMIN returns an error.
Keywords
ACCOUNT
andACCOUNTS
are both supported and can be used interchangeably.
Examples¶
Add two accounts to the existing share named sales_s
:
ALTER SHARE sales_s ADD ACCOUNTS=xy12345,yz23456; +----------------------------------+ | status | |----------------------------------| | Statement executed successfully. | +----------------------------------+
Remove account yz23456
from sales_s
:
ALTER SHARE sales_s REMOVE ACCOUNT=yz23456; +----------------------------------+ | 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. | +----------------------------------+