Drops an abstract plan.
sp_drop_qplan id
is the ID of the abstract plan to drop.
The abstract plan with the specified ID is dropped:
sp_drop_qplan 1760009301
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.
The permission checks for sp_drop_qplans differ based on your granular permissions settings.
| Granular permissions 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. | 
| Granular permissions 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. | 
Values in event and extrainfo columns from the sysaudits table are:
| Event | Audit option | Command or access audited | Information in extrainfo | 
|---|---|---|---|
| 38 | exec_procedure | Execution of a procedure | 
 | 
Commands create plan
System procedures sp_drop_all_qplans, sp_find_qplan, sp_help_qpgroup, sp_help_qplan