Join us for a live demo and deep-dive of Instant SQL on May 14Register Now

Skip to main content

REVOKE READ ON SHARE

For restricted shares, use the REVOKE command to explicitly remove share access from users that have an existing GRANT. After running a REVOKE command there may be a delay of a few minutes before access is fully removed if a user is currently querying the share. Only the owner of the share can use the REVOKE command to remove access from others. GRANT and REVOKE do not apply to UNRESTRICTED shares.

Syntax

REVOKE READ ON SHARE <share name> FROM <username> [, <username2>, <username3>];

If a username contains special characters, such as '@', it must be enclosed in double quotes (").

Example usage

-- revokes access to the share 'birds' from the user with username 'duck'
REVOKE READ ON SHARE birds FROM duck;

-- revokes access to the share 'taxis' from the users with usernames 'usr1' and 'usr2'
REVOKE READ ON SHARE taxis FROM usr1, usr2;

-- revokes access from a user whose username contains special characters
REVOKE READ ON SHARE sensitive_data FROM "user@example-com";