sp_copy_qplan

Description

Copies one abstract plan to an abstract plan group.

Syntax

sp_copy_qplan src_id, dest_group

Parameters

src_id

is the ID of the abstract plan to copy.

dest_group

is the name of the destination abstract plan group.

Examples

Example 1

sp_copy_qplan 2140534659, ap_stdin

Usage

Permissions

The permission checks for sp_copy_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 execute sp_copy_qplan to copy a plan that they own.

Granular permissions disabled

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

Any user execute sp_copy_qplan to copy a plan that 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

System procedures sp_copy_all_qplans, sp_help_qpgroup, sp_help_qplan, sp_import_qpgroup