sp_set_qplan

Description

Changes the text of the abstract plan of an existing plan without changing the associated query.

Syntax

sp_set_qplan id, plan

Parameters

id

is the ID of the abstract plan.

plan

is a new abstract plan.

Examples

Example 1

sp_set_qplan 563789159, 
        "( g_join (scan t1) (scan t2))"

Usage

Permissions

The permission checks for sp_set_qplan 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_set_qplan to change the text of a plan for which 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_set_qplan to change the text of a plan for which they own.

Auditing

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

  • 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

See also

Commands create plan

System procedures sp_drop_qpgroup, sp_drop_qplan, sp_find_qplan, sp_help_qplan