REVOKE XML Schema Collection Permissions (Transact-SQL)
Revokes permissions granted or denied on an XML schema collection.
REVOKE [ GRANT OPTION FOR ] permission [ ,...n ] ON
XML SCHEMA COLLECTION :: [ schema_name . ]
XML_schema_collection_name
{ TO | FROM } <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
Information about XML schema collections is visible in the sys.xml_schema_collections catalog view.
The statement will fail if CASCADE is not specified when you are revoking a permission from a principal that was granted that permission with GRANT OPTION specified.
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 revoked 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 permission | Implied by XML schema collection permission | Implied by schema permission |
|---|---|---|
ALTER | CONTROL | ALTER |
CONTROL | CONTROL | CONTROL |
EXECUTE | CONTROL | EXECUTE |
REFERENCES | CONTROL | REFERENCES |
TAKE OWNERSHIP | CONTROL | CONTROL |
VIEW DEFINITION | CONTROL | VIEW DEFINITION |
The following example revokes EXECUTE permission on the XML schema collection Invoices4 from the user Wanida. The XML schema collection Invoices4 is located inside the Sales schema of the AdventureWorks database.
USE AdventureWorks;
REVOKE EXECUTE ON XML SCHEMA COLLECTION::Sales.Invoices4 FROM Wanida;
GO
