EN
Ta vsebina ni na voljo v vašem jeziku, vendar pa je tukaj angleška različica.

REVOKE Server 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

Removes server-level GRANT and DENY permissions.

Topic link icon Transact-SQL Syntax Conventions

  
REVOKE [ GRANT OPTION FOR ] permission  [ ,...n ]   
    { TO | FROM } <grantee_principal> [ ,...n ]  
        [ CASCADE ]  
    [ AS <grantor_principal> ]   
  
<grantee_principal> ::= SQL_Server_login   
        | SQL_Server_login_mapped_to_Windows_login  
    | SQL_Server_login_mapped_to_Windows_group  
    | SQL_Server_login_mapped_to_certificate  
    | SQL_Server_login_mapped_to_asymmetric_key  
    | server_role  
  
<grantor_principal> ::= SQL_Server_login   
    | SQL_Server_login_mapped_to_Windows_login  
    | SQL_Server_login_mapped_to_Windows_group  
    | SQL_Server_login_mapped_to_certificate  
    | SQL_Server_login_mapped_to_asymmetric_key  
    | server_role  

permission
Specifies a permission that can be granted on a server. For a list of the permissions, see the Remarks section later in this topic.

{ TO | FROM } <grantee_principal>
Specifies the principal from which the permission is being revoked.

AS <grantor_principal>
Specifies the principal from which the principal executing this query derives its right to revoke the permission.

GRANT OPTION FOR
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.

SQL_Server_login
Specifies a SQL Server login.

SQL_Server_login_mapped_to_Windows_login
Specifies a SQL Server login mapped to a Windows login.

SQL_Server_login_mapped_to_Windows_group
Specifies a SQL Server login mapped to a Windows group.

SQL_Server_login_mapped_to_certificate
Specifies a SQL Server login mapped to a certificate.

SQL_Server_login_mapped_to_asymmetric_key
Specifies a SQL Server login mapped to an asymmetric key.

server_role
Specifies a user-defined server role.

Permissions at the server scope can be revoked only when the current database is master.

REVOKE removes both GRANT and DENY permissions.

Use REVOKE GRANT OPTION FOR to revoke the right to regrant the specified permission. If the principal has the permission with the right to grant it, the right to grant the permission will be revoked, and the permission itself will not be revoked. But if the principal has the specified permission without the GRANT option, the permission itself will be revoked.

Information about server permissions can be viewed in the sys.server_permissions catalog view, and information about server principals can be viewed in the sys.server_principals catalog view. Information about membership of server roles can be viewed in the sys.server_role_members catalog view.

A server is the highest level of the permissions hierarchy. The most specific and limited permissions that can be revoked on a server are listed in the following table.

Server permissionImplied by server permission
ADMINISTER BULK OPERATIONSCONTROL SERVER
ALTER ANY AVAILABILITY GROUP

 Applies to: SQL Server (SQL Server 2012 through current version).
CONTROL SERVER
ALTER ANY CONNECTIONCONTROL SERVER
ALTER ANY CREDENTIALCONTROL SERVER
ALTER ANY DATABASECONTROL SERVER
ALTER ANY ENDPOINTCONTROL SERVER
ALTER ANY EVENT NOTIFICATIONCONTROL SERVER
ALTER ANY EVENT SESSIONCONTROL SERVER
ALTER ANY LINKED SERVERCONTROL SERVER
ALTER ANY LOGINCONTROL SERVER
ALTER ANY SERVER AUDITCONTROL SERVER
ALTER ANY SERVER ROLE

 Applies to: SQL Server (SQL Server 2012 through current version).
CONTROL SERVER
ALTER RESOURCESCONTROL SERVER
ALTER SERVER STATECONTROL SERVER
ALTER SETTINGSCONTROL SERVER
ALTER TRACECONTROL SERVER
AUTHENTICATE SERVERCONTROL SERVER
CONNECT ANY DATABASE

 Applies to: SQL Server (SQL Server 2014 through current version).
CONTROL SERVER
CONNECT SQLCONTROL SERVER
CONTROL SERVERCONTROL SERVER
CREATE ANY DATABASEALTER ANY DATABASE
CREATE AVAILABILITY GROUP

 Applies to: SQL Server (SQL Server 2012 through current version).
ALTER ANY AVAILABILITY GROUP
CREATE DDL EVENT NOTIFICATIONALTER ANY EVENT NOTIFICATION
CREATE ENDPOINTALTER ANY ENDPOINT
CREATE SERVER ROLE

 Applies to: SQL Server (SQL Server 2012 through current version).
ALTER ANY SERVER ROLE
CREATE TRACE EVENT NOTIFICATIONALTER ANY EVENT NOTIFICATION
EXTERNAL ACCESS ASSEMBLYCONTROL SERVER
IMPERSONATE ANY LOGIN

 Applies to: SQL Server (SQL Server 2014 through current version).
CONTROL SERVER
SELECT ALL USER SECURABLES

 Applies to: SQL Server (SQL Server 2014 through current version).
CONTROL SERVER
SHUTDOWNCONTROL SERVER
UNSAFE ASSEMBLYCONTROL SERVER
VIEW ANY DATABASEVIEW ANY DEFINITION
VIEW ANY DEFINITIONCONTROL SERVER
VIEW SERVER STATEALTER SERVER STATE

Requires CONTROL SERVER permission or membership in the sysadmin fixed server role.

A. Revoking a permission from a login

The following example revokes VIEW SERVER STATE permission from the SQL Server login WanidaBenshoof.

USE master;  
REVOKE VIEW SERVER STATE FROM WanidaBenshoof;  
GO  

B. Revoking the WITH GRANT option

The following example revokes the right to grant CONNECT SQL from the SQL Server login JanethEsteves.

USE master;  
REVOKE GRANT OPTION FOR CONNECT SQL FROM JanethEsteves;  
GO  

The login still has CONNECT SQL permission, but it can no longer grant that permission to other principals.

GRANT (Transact-SQL)
DENY (Transact-SQL)
DENY Server Permissions (Transact-SQL)
REVOKE Server Permissions (Transact-SQL)
Permissions Hierarchy (Database Engine)
sys.fn_builtin_permissions (Transact-SQL)
sys.fn_my_permissions (Transact-SQL)
HAS_PERMS_BY_NAME (Transact-SQL)

Vsebina skupnosti

Dodaj
Pokaži: