sp_procqmode

Description

Displays the query processing mode of a stored procedure, view, or trigger.

Syntax

sp_procqmode [object_name [, detail]]

Parameters

object_name

is the name of the stored procedure, view, or trigger whose query processing mode you are examining. If you do not specify an object_name, sp_procqmode reports on all procedures, views, and triggers in the current database.

detail

returns information about whether the object contains a subquery, and whether there is information about the object in syscomments.

Examples

Example 1

Displays the query processing mode for all stored procedures in the current database:

sp_procqmode

Object Owner.name  Object Type        Processing Mode
-----------------  ----------------   --------------
dbo.au_info        stored procedure   pre-System 11
dbo.titleview      view               System 11 or later

Example 2

Displays the query processing mode of the stored procedure old_sproc, reports whether old_sproc contains any subqueries, and reports whether syscomments has information about old_sproc:

sp_procqmode old_sproc, detail

Object Owner.Name     Object Type       Processing Mode     Subq Text
--------------------- ----------------- ------------------- ---- ----
dbo.au_info           stored procedure  pre-System 11       no   yes

Example 3

Displays detailed reports for all objects in the database:

sp_procqmode null, detail

Usage

Permissions

Only theDatabase Owner or object owner can execute sp_procqmode.

See also

Stored Procedures sp_helptext

Utilities defncopy