REVOKE <PRIVILEGE>
statementnot supportedAccess control (grants, roles)Revokes access privileges for databases and other supported database objects (schemas, tables, views, and models) from a share. Revoking privileges on these objects effectively removes the objects from the share, disabling access to the objects granted via the database role in all consumer accounts that have created a database from the share. For more details, see About Secure Data Sharing and Create and configure shares.
Syntax
REVOKE objectPrivilege ON
{ DATABASE <name>
| SCHEMA <name>
| MODEL <name>
| SEMANTIC VIEW <name>
| { TABLE <name> | ALL TABLES IN SCHEMA <schema_name> }
| { EXTERNAL TABLE <name> | ALL EXTERNAL TABLES IN SCHEMA <schema_name> }
| { ICEBERG TABLE <name> | ALL ICEBERG TABLES IN SCHEMA <schema_name> }
| { DYNAMIC TABLE <name> | ALL DYNAMIC TABLES IN SCHEMA <schema_name> }
| { VIEW <name> | ALL VIEWS IN SCHEMA <schema_name> } }
FROM SHARE <share_name>
Where
objectPrivilege ::=
-- For DATABASE
REFERENCE_USAGE [ , ... ]
-- For DATABASE, FUNCTION, MODEL, or SCHEMA
USAGE [ , ... ]
-- For MODEL or TAG
READ
-- For SEMANTIC VIEW
{ REFERENCES | SELECT } [ , ... ]
-- For TABLE
EVOLVE SCHEMA [ , ... ]
-- For EXTERNAL TABLE, ICEBERG TABLE, TABLE, or VIEW
SELECT [ , ... ]
Parameters
| Name | Required | Description |
|---|---|---|
name | Specifies the identifier for the object (database, schema, table, view, or model) for which the specified privilege is revoked. | |
schema_name | Specifies the identifier for the schema for which the specified privilege is revoked for all tables or views. | |
share_name | Specifies the identifier for the share for which the specified privilege is revoked. |
Usage notes
- Each object privilege must be revoked individually from a share, except for tables, Apache Iceberg™ tables, and views. Using an ALL clause, you can revoke the SELECT privilege on all tables in the specified schema from a share. You can also revoke the SELECT privilege on all views in a schema from a share if the share has SECURE_OBJECTS_ONLY=FALSE.
- If you specify a TABLE object that is an Iceberg table, the command revokes the privilege from that Iceberg table.