Managing Plan Guides

You use the sp_control_plan_guide stored procedure to enable, disable, or drop a plan guide. The following example drops the plan guide created in Listing 35.3:

sp_control_plan_guide N'DROP', N'PlanGuide1'

To execute sp_control_plan_guide on a plan guide of type OBJECT (for example, a plan guide created for a stored procedure), you must have at least ALTER permission on the object that is referenced by the plan guide. For all other plan guides, you must have at least ALTER DATABASE permission. Attempting to drop or alter a function or stored procedure that is referenced by a plan guide results in an error.

In SQL Server 2014, it is possible to define multiple plan guides for the same query. However, ...

Get Microsoft SQL Server 2014 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.