Skip to content

Latest commit

 

History

History
124 lines (96 loc) · 6.21 KB

File metadata and controls

124 lines (96 loc) · 6.21 KB
title DENY Availability Group Permissions (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 05/15/2017
ms.prod sql-non-specified
ms.reviewer
ms.suite
ms.technology
database-engine
ms.tgt_pltfrm
ms.topic language-reference
dev_langs
TSQL
helpviewer_keywords
Availability Groups [SQL Server], permissions
permissions [SQL Server], availability group
DENY statement, availability groups
denying permissions, [SQL Server], availability groups
ms.assetid bda60b36-a0b9-4c20-80c1-6a5cb1d638a5
caps.latest.revision 12
author BYHAM
ms.author rickbyh
manager jhubbard

DENY Availability Group Permissions (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2012-xxxx-xxxx-xxx_md]

Denies permissions on an Always On availability group in [!INCLUDEssNoVersion].

Topic link icon Transact-SQL Syntax Conventions

Syntax

DENY permission  [ ,...n ] ON AVAILABILITY GROUP :: availability_group_name  
        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  

Arguments

permission
Specifies a permission that can be denied on an availability group. For a list of the permissions, see the Remarks section later in this topic.

ON AVAILABILITY GROUP ::availability_group_name
Specifies the availability group on which the permission is being denied. The scope qualifier (::
) is required.

TO <server_principal>
Specifies the [!INCLUDEssNoVersion] login to which the permission is being denied.

SQL_Server_login
Specifies the name of a [!INCLUDEssNoVersion] login.

SQL_Server_login_from_Windows_login
Specifies the name of a [!INCLUDEssNoVersion] login created from a Windows login.

SQL_Server_login_from_certificate
Specifies the name of a [!INCLUDEssNoVersion] login mapped to a certificate.

SQL_Server_login_from_AsymKey
Specifies the name of a [!INCLUDEssNoVersion] login mapped to an asymmetric key.

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

AS SQL_Server_login
Specifies the [!INCLUDEssNoVersion] login from which the principal executing this query derives its right to deny the permission.

Remarks

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

Information about availability groups is visible in the sys.availability_groups (Transact-SQL) catalog view. Information about server permissions is visible in the sys.server_permissions catalog view, and information about server principals is visible in the sys.server_principals catalog view.

An availability group is a server-level securable. The most specific and limited permissions that can be denied on an availability group are listed in the following table, together with the more general permissions that include them by implication.

Availability group permission Implied by availability group permission Implied by server permission
ALTER CONTROL ALTER ANY AVAILABILITY GROUP
CONNECT CONTROL CONTROL SERVER
CONTROL CONTROL CONTROL SERVER
TAKE OWNERSHIP CONTROL CONTROL SERVER
VIEW DEFINITION CONTROL VIEW ANY DEFINITION

Permissions

Requires CONTROL permission on the availability group or ALTER ANY AVAILABILTIY GROUP permission on the server.

Examples

A. Denying VIEW DEFINITION permission on an availability group

The following example denies VIEW DEFINITION permission on availability group MyAg to [!INCLUDEssNoVersion] login ZArifin.

USE master;  
DENY VIEW DEFINITION ON AVAILABILITY GROUP::MyAg TO ZArifin;  
GO  

B. Denying TAKE OWNERSHIP permission with the CASCADE OPTION

The following example denies TAKE OWNERSHIP permission on availability group MyAg to [!INCLUDEssNoVersion] user PKomosinski with the CASCADE option.

USE master;  
DENY TAKE OWNERSHIP ON AVAILABILITY GROUP::MyAg TO PKomosinski   
    CASCADE;  
GO  

See Also

REVOKE Availability Group Permissions (Transact-SQL)
GRANT Availability Group Permissions (Transact-SQL)
CREATE AVAILABILITY GROUP (Transact-SQL)
sys.availability_groups (Transact-SQL)
Always On Availability Groups Catalog Views (Transact-SQL)
Permissions (Database Engine)
Principals (Database Engine)