TechNet
Export (0) Print
Expand All

DENY XML Schema Collection Permissions (Transact-SQL)

 

Updated: November 25, 2015

Applies To: Azure SQL Database, SQL Server (starting with 2008)

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

Denies permissions on an XML schema collection.

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

Topic link icon Transact-SQL Syntax Conventions

  
DENY permission  [ ,...n ] ON   
    XML SCHEMA COLLECTION :: [ schema_name . ]  
    XML_schema_collection_name  
    TO <database_principal> [ ,...n ]  
        [ CASCADE ]  
    [ AS <database_principal> ]   
  
<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  

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

ON XML SCHEMA COLLECTION :: [ schema_name. ] XML_schema_collection_name
Specifies the XML schema collection on which the permission is being denied. The scope qualifier (::) is required. If schema_name is not specified, the default schema will be used. If schema_name is specified, the schema scope qualifier (.) is required.

TO <database_principal>
Specifies the principal to which the permission is being denied.

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

AS <database_principal>
Specifies a principal from which the principal executing this query derives its right to deny the permission.

Database_user
Specifies a database user.

Database_role
Specifies a database role.

Application_role
Specifies an application role.

Database_user_mapped_to_Windows_User
Specifies a database user mapped to a Windows user.

Database_user_mapped_to_Windows_Group
Specifies a database user mapped to a Windows group.

Database_user_mapped_to_certificate
Specifies a database user mapped to a certificate.

Database_user_mapped_to_asymmetric_key
Specifies a database user mapped to an asymmetric key.

Database_user_with_no_login
Specifies a database user with no corresponding server-level principal.

Information about XML schema collections is visible in the sys.xml_schema_collections catalog view.

An XML schema collection 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 denied on an XML schema collection are listed in the following table, together with the more general permissions that include them by implication.

XML schema collection permissionImplied by XML schema collection permissionImplied by schema permission
ALTERCONTROLALTER
CONTROLCONTROLCONTROL
EXECUTECONTROLEXECUTE
REFERENCESCONTROLREFERENCES
TAKE OWNERSHIPCONTROLCONTROL
VIEW DEFINITIONCONTROLVIEW DEFINITION

Requires CONTROL on the XML schema collection. If you use the AS option, the specified principal must own the XML schema collection.

The following example denies EXECUTE permission on the XML schema collection Invoices4 to the user Wanida. The XML schema collection Invoices4 is located inside the Sales schema of the AdventureWorks2012 database.

USE AdventureWorks2012;  
DENY EXECUTE ON XML SCHEMA COLLECTION::Sales.Invoices4 TO Wanida;  
GO  

GRANT XML Schema Collection Permissions (Transact-SQL)
REVOKE XML Schema Collection Permissions (Transact-SQL)
sys.xml_schema_collections (Transact-SQL)
CREATE XML SCHEMA COLLECTION (Transact-SQL)
Permissions (Database Engine)
Principals (Database Engine)

Community Additions

ADD
Show:
© 2016 Microsoft