sp_drop_qplan

Drops an abstract plan.

Syntax

sp_drop_qplan id

Parameters

Examples

Usage

To find the ID of a plan, use sp_help_qpgroup, sp_help_qplan, or sp_find_qplan. Plan IDs are also returned by create plan and are included in showplan output.

To drop all abstract plans in a group, use sp_drop_all_qplans.

See also create plan in Reference Manual: Commands.

Permissions

The permission checks for sp_drop_qplans differ based on your granular permissions settings.

SettingDescription
Enabled

With granular permissions enabled, you must be a user with manage abstract plans privilege.

Any user can execute sp_drop_qplans to drop plans that they own.

Disabled

With granular permissions disabled, you must be the database owner or a user with sa_role.

Any user can execute sp_drop_qplans to drop plans that they own.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

InformationValues
Event

38

Audit option

exec_procedure

Command or access audited

Execution of a procedure

Information in extrainfo
  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

Related reference
sp_drop_all_qplans
sp_find_qplan
sp_help_qpgroup
sp_help_qplan