Difference Between Grant and Revoke


In this post, we will understand the difference between grant and revoke.

Grant

  • It is a DCL command.

  • It grants permissions to users on database objects.

  • It can also be used to assign access rights to users.

  • For every user, the permissions need to be specified.

  • When the access is decentralized, permission granting is easier.

Syntax:

grant privilege_name on object_name
to {user_name | public | role_name}

Revoke

  • It is a DCL command.

  • It removes permissions if they are granted to users on database objects.

  • It takes away/revokes the rights of the users.

  • If access for a user is removed, all specific permissions provided by that user to others will be removed.

  • If decentralized access is used, it would be difficult to remove granted permissions.

Syntax

revoke privilege_name on object_name
from {user_name | public | role_name}

Updated on: 25-Mar-2021

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements