sp_cmp_qplans

Description

Compares two abstract plans.

Syntax

sp_cmp_qplans id1, id2

Parameters

id1, id2

are the IDs of two abstract plans.

Examples

Example 1

Compares abstract plan 411252620 to 1383780087:

sp_cmp_qplans 411252620, 1383780087
The queries are the same.
The query plans are the same.

Example 2

Compares abstract plan 2091258605 to 647777465:

sp_cmp_qplans 2091258605, 647777465
The queries are the same.
The query plans are different.

Usage

Permissions

Any user can execute sp_cmp_qplans to compare plans that he or she owns. Only a System Administrator or the Database Owner can compare plans owned by another user.

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_cmp_all_qplans, sp_help_qpgroup