REVOKE Endpoint Permissions (Transact-SQL)
Revokes permissions granted or denied on an endpoint.
REVOKE [ GRANT OPTION FOR ] permission [ ,...n ]
ON ENDPOINT ::endpoint_name
{ FROM | 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
Permissions at the server scope can be revoked 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 revoked 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. Revoking VIEW DEFINITION permission on an endpoint
The following example revokes VIEW DEFINITION permission on the endpoint Mirror7 from the SQL Server login ZArifin.
USE master; REVOKE VIEW DEFINITION ON ENDPOINT::Mirror7 FROM ZArifin; GO
B. Revoking TAKE OWNERSHIP permission with the CASCADE option
The following example revokes TAKE OWNERSHIP permission on the endpoint Shipping83 from the SQL Server user PKomosinski and from all principals to which PKomosinski granted TAKE OWNERSHIP on Shipping83.
USE master;
REVOKE TAKE OWNERSHIP ON ENDPOINT::Shipping83 FROM PKomosinski
CASCADE;
GO
