O'Reilly logo

SQL in a Nutshell by Kevin Kline

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

REVOKE

Synopsis

The REVOKE statement removes permissions for a user, group, or role on a specific database object or system command.

Vendor

Command

SQL Server

Supported, with variations

MySQL

Supported, with variations

Oracle

Supported, with variations

PostgreSQL

Supported, with variations

SQL99 Syntax and Description

REVOKE [GRANT OPTION FOR]
{ ALL PRIVILEGES }
| SELECT
| INSERT 
| DELETE
| UPDATE 
| REFERENCES 
| USAGE }[,...n]
ON { [TABLE] table_name 
| DOMAIN domain_name
| COLLATION collation_name
| CHARACTER SET character_set_name
| TRANSLATION translation_name }
FROM {grantee_name | PUBLIC} [,...n]
{CASCADE | RESTRICT}

A specific privilege on a specific database object can be revoked for a single user using REVOKE privilege_name ON object_name FROM grantee_name. A specific privilege on a specific object may be revoked from all users via the PUBLIC clause. As an alternative, the WITH GRANT OPTION can be used to revoke permissions using the REVOKE GRANT OPTION FOR clause.

The RESTRICT option revokes only the specified privilege. The CASCADE option revokes the specified privilege and any privileges that are dependent upon the granted privilege. A cascading revocation may exhibit different behavior on different database platforms, so be sure to read the vendor documentation for the correct implementation of this option.

Microsoft SQL Server Syntax and Variations

REVOKE [GRANT OPTION FOR] {ALL [ PRIVILEGES ] | SELECT | INSERT | DELETE | UPDATE | REFERENCES | EXECUTE | CREATE ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required