Share via


Syntax for Granting, Denying, and Revoking the SHOWPLAN Permission

The SHOWPLAN permission is a database-level permission. In general, the syntax for granting, denying, and revoking the SHOWPLAN permission is modeled after the other database level permissions. However, some of the GRANT, DENY, and REVOKE clauses that are available with other database-level permissions can not be used with the SHOWPLAN permission. The following sections provide the syntax for GRANTING, DENYING, and REVOKING the SHOWPLAN permission, and explain what clauses do not apply to SHOWPLAN. For more information about the general syntax for granting, denying, and revoking database-level permissions, see GRANT Database Permissions (Transact-SQL), DENY Database Permissions (Transact-SQL), and REVOKE Database Permissions (Transact-SQL).

Syntax

To grant the SHOWPLAN permission
GRANT SHOWPLAN
TO <database_principal> [ , ...n ]

To deny the SHOWPLAN permission
DENY SHOWPLAN
TO <database_principal> [ , ...n ]

To revoke the SHOWPLAN permission
REVOKE SHOWPLAN
FROM <database_principal> [ , ...n ]

Restrictions

You cannot use the following clauses for granting the SHOWPLAN permission:

  • WITH GRANT OPTION

  • AS

You cannot use the following clauses for denying the SHOWPLAN permission:

  • CASCADE (because SHOWPLAN cannot be granted using the WITH GRANT OPTION clause)

  • AS

You cannot use the following clauses for revoking the SHOWPLAN permission:

  • GRANT OPTION FOR

  • CASCADE

  • AS

See Also

Concepts