DENY Endpoint Permissions (Transact-SQL)
Denies permissions on an endpoint.
Permissions at the server scope can be denied only when the current database is master.
Information about endpoints is visible in the sys.endpoints 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 endpoint is a server-level securable. The most specific and limited permissions that can be denied on an endpoint are listed in the following table, together with the more general permissions that include them by implication.
|
Endpoint permission |
Implied by endpoint permission |
Implied by server permission |
|---|---|---|
|
ALTER |
CONTROL |
ALTER ANY ENDPOINT |
|
CONNECT |
CONTROL |
CONTROL SERVER |
|
CONTROL |
CONTROL |
CONTROL SERVER |
|
TAKE OWNERSHIP |
CONTROL |
CONTROL SERVER |
|
VIEW DEFINITION |
CONTROL |
VIEW ANY DEFINITION |
A. Denying VIEW DEFINITION permission on an endpoint
The following example denies VIEW DEFINITION permission on the endpoint Mirror7 to the SQL Server login ZArifin.
USE master; DENY VIEW DEFINITION ON ENDPOINT::Mirror7 TO ZArifin; GO
B. Denying TAKE OWNERSHIP permission with CASCADE option
The following example denies TAKE OWNERSHIP permission on the endpoint Shipping83 to the SQL Server user PKomosinski and to principals to which PKomosinski granted TAKE OWNERSHIP.
USE master;
DENY TAKE OWNERSHIP ON ENDPOINT::Shipping83 TO PKomosinski
CASCADE;
GO