DENY Schema Permissions (Transact-SQL)

**APPLIES TO:** ![yes](media/yes.png)SQL Server (starting with 2008) ![yes](media/yes.png)Azure SQL Database ![no](media/no.png)Azure SQL Data Warehouse ![no](media/no.png)Parallel Data Warehouse

Denies permissions on a schema.

Topic link icon Transact-SQL Syntax Conventions

Syntax

DENY permission  [ ,...n ] } ON SCHEMA :: schema_name  
    TO database_principal [ ,...n ]   
    [ CASCADE ]  
        [ AS denying_principal ]  

Arguments

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

ON SCHEMA :: schema*_name*
Specifies the schema on which the permission is being denied. The scope qualifier :: is required.

database_principal
Specifies the principal to which the permission is being denied. database_principal can be one of the following:

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

denying_principal
Specifies a principal from which the principal executing this query derives its right to deny the permission. denying_principal can be one of the following:

Remarks

A schema is a database-level securable that is contained by the database that is its parent in the permissions hierarchy. The most specific and limited permissions that can be denied on a schema are listed in the following table, together with the more general permissions that include them by implication.

Schema permission Implied by schema permission Implied by database permission
ALTER CONTROL ALTER ANY SCHEMA
CONTROL CONTROL CONTROL
CREATE SEQUENCE ALTER ALTER ANY SCHEMA
DELETE CONTROL DELETE
EXECUTE CONTROL EXECUTE
INSERT CONTROL INSERT
REFERENCES CONTROL REFERENCES
SELECT CONTROL SELECT
TAKE OWNERSHIP CONTROL CONTROL
UPDATE CONTROL UPDATE
VIEW CHANGE TRACKING CONTROL CONTROL
VIEW DEFINITION CONTROL VIEW DEFINITION

Permissions

Requires CONTROL permission on the schema. If you are using the AS option, the specified principal must own the schema.

See Also

CREATE SCHEMA (Transact-SQL)
DENY (Transact-SQL)
Permissions (Database Engine)
Principals (Database Engine)
sys.fn_builtin_permissions (Transact-SQL)
sys.fn_my_permissions (Transact-SQL)
HAS_PERMS_BY_NAME (Transact-SQL)