REVOKE Server Principal Permissions (Transact-SQL)

REVOKE Server Principal Permissions (Transact-SQL)

 

Updated: June 10, 2016

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

Revokes permissions granted or denied on a SQL Server login.

Applies to: SQL Server (SQL Server 2008 through current version).

Topic link icon Transact-SQL Syntax Conventions

  
REVOKE [ GRANT OPTION FOR ] permission [ ,...n ] }   
    ON   
    { [ LOGIN :: SQL_Server_login ]  
      | [ SERVER ROLE :: server_role ] }   
    { FROM | TO } <server_principal> [ ,...n ]  
    [ CASCADE ]  
    [ AS SQL_Server_login ]   
  
<server_principal> ::=   
    SQL_Server_login  
    | SQL_Server_login_from_Windows_login   
    | SQL_Server_login_from_certificate   
    | SQL_Server_login_from_AsymKey     
    | server_role  

permission
Specifies a permission that can be revoked on a SQL Server login. For a list of the permissions, see the Remarks section later in this topic.

LOGIN :: SQL_Server_login
Specifies the SQL Server login on which the permission is being revoked. The scope qualifier (::) is required.

SERVER ROLE :: server_role
Specifies the server role on which the permission is being revoked. The scope qualifier (::) is required.

{ FROM | TO } <server_principal>
Specifies the SQL Server login or server role from which the permission is being revoked.

SQL_Server_login
Specifies the name of a SQL Server login.

SQL_Server_login_from_Windows_login
Specifies the name of a SQL Server login created from a Windows login.

SQL_Server_login_from_certificate
Specifies the name of a SQL Server login mapped to a certificate.

SQL_Server_login_from_AsymKey
Specifies the name of a SQL Server login mapped to an asymmetric key.

server_role
Specifies the name of a user-defined server role.

GRANT OPTION
Indicates that the right to grant the specified permission to other principals will be revoked. The permission itself will not be revoked.

System_CAPS_ICON_important.jpg Important


If the principal has the specified permission without the GRANT option, the permission itself will be revoked.

CASCADE
Indicates that the permission being revoked is also revoked from other principals to which it has been granted or denied by this principal.

System_CAPS_ICON_caution.jpg Caution


A cascaded revocation of a permission granted WITH GRANT OPTION will revoke both GRANT and DENY of that permission.

AS SQL_Server_login
Specifies the SQL Server login from which the principal executing this query derives its right to revoke the permission.

SQL Server logins and server roles are server-level securables. The most specific and limited permissions that can be revoked on a SQL Server login or server role are listed in the following table, together with the more general permissions that include them by implication.

SQL Server login or server role permissionImplied by SQL Server login or server role permissionImplied by server permission
CONTROLCONTROLCONTROL SERVER
IMPERSONATECONTROLCONTROL SERVER
VIEW DEFINITIONCONTROLVIEW ANY DEFINITION
ALTERCONTROLALTER ANY LOGIN

ALTER ANY SERVER ROLE

For logins, requires CONTROL permission on the login or ALTER ANY LOGIN permission on the server.

For server roles, requires CONTROL permission on the server role or ALTER ANY SERVER ROLE permission on the server.

A. Revoking IMPERSONATE permission on a login

The following example revokes IMPERSONATE permission on the SQL Server login WanidaBenshoof from a SQL Server login created from the Windows user AdvWorks\YoonM.

USE master;  
REVOKE IMPERSONATE ON LOGIN::WanidaBenshoof FROM [AdvWorks\YoonM];  
GO  

B. Revoking VIEW DEFINITION permission with CASCADE

The following example revokes VIEW DEFINITION permission on the SQL Server login EricKurjan from the SQL Server login RMeyyappan. The CASCADE option indicates that VIEW DEFINITION permission on EricKurjan will also be revoked from the principals to which RMeyyappan granted this permission.

USE master;  
REVOKE VIEW DEFINITION ON LOGIN::EricKurjan FROM RMeyyappan   
    CASCADE;  
GO   

C. Revoking VIEW DEFINITION permission on a server role

The following example revokes VIEW DEFINITION on the Sales server role to the Auditors server role.

USE master;  
REVOKE VIEW DEFINITION ON SERVER ROLE::Sales TO Auditors ;  
GO   

sys.server_principals (Transact-SQL)
sys.server_permissions (Transact-SQL)
GRANT Server Principal Permissions (Transact-SQL)
DENY Server Principal Permissions (Transact-SQL)
CREATE LOGIN (Transact-SQL)
Principals (Database Engine)
Permissions (Database Engine)
Security Functions (Transact-SQL)
Security Stored Procedures (Transact-SQL)

Community Additions

ADD
Show:
© 2016 Microsoft