REVOKE Object Permissions (Transact-SQL)
Revokes permissions on a table, view, table-valued function, stored procedure, extended stored procedure, scalar function, aggregate function, service queue, or synonym.
REVOKE [ GRANT OPTION FOR ] <permission> [ ,...n ] ON
[ OBJECT :: ][ schema_name ]. object_name [ ( column [ ,...n ] ) ]
{ FROM | TO } <database_principal> [ ,...n ]
[ CASCADE ]
[ AS <database_principal> ]
<permission> ::=
ALL [ PRIVILEGES ] | permission [ ( column [ ,...n ] ) ]
<database_principal> ::=
Database_user
| Database_role
| Application_role
| Database_user_mapped_to_Windows_User
| Database_user_mapped_to_Windows_Group
| Database_user_mapped_to_certificate
| Database_user_mapped_to_asymmetric_key
| Database_user_with_no_login
Information about objects is visible in various catalog views. For more information, see Object Catalog Views (Transact-SQL).
An object is a schema-level securable contained by the schema that is its parent in the permissions hierarchy. The most specific and limited permissions that can be revoked on an object are listed in the following table, together with the more general permissions that include them by implication.
Object permission | Implied by object permission | Implied by schema permission |
|---|---|---|
ALTER | CONTROL | ALTER |
CONTROL | CONTROL | CONTROL |
DELETE | CONTROL | DELETE |
EXECUTE | CONTROL | EXECUTE |
INSERT | CONTROL | INSERT |
RECEIVE | CONTROL | CONTROL |
REFERENCES | CONTROL | REFERENCES |
SELECT | RECEIVE | SELECT |
TAKE OWNERSHIP | CONTROL | CONTROL |
UPDATE | CONTROL | UPDATE |
VIEW CHANGE TRACKING | CONTROL | VIEW CHANGE TRACKING |
VIEW DEFINITION | CONTROL | VIEW DEFINITION |
A. Revoking SELECT permission on a table
The following example revokes SELECT permission from the user RosaQdM on the table Person.Address in the AdventureWorks2008R2 database.
USE AdventureWorks2008R2; REVOKE SELECT ON OBJECT::Person.Address FROM RosaQdM; GO
B. Revoking EXECUTE permission on a stored procedure
The following example revokes EXECUTE permission on the stored procedure HumanResources.uspUpdateEmployeeHireInfo from an application role called Recruiting11.
USE AdventureWorks2008R2;
REVOKE EXECUTE ON OBJECT::HumanResources.uspUpdateEmployeeHireInfo
FROM Recruiting11;
GO
C. Revoking REFERENCES permission on a view with CASCADE
The following example revokes REFERENCES permission on the column BusinessEntityID in the view HumanResources.vEmployee from the user Wanida with CASCADE.
USE AdventureWorks2008R2;
REVOKE REFERENCES (BusinessEntityID) ON OBJECT::HumanResources.vEmployee
FROM Wanida CASCADE;
GO