sp_iqworkmon Procedure

Controls collection of workload monitor usage information, and reports monitoring collection status. sp_iqworkmon collects information only for queries (SQL statements containing a FROM clause). You cannot use sp_iqworkmon for INSERT or LOAD statements.

Syntax

sp_iqworkmon ‘action’ ] [ , ‘mode’ ]
action = ‘start’ , ‘stop’ , ’status’ , ‘reset’
mode = ‘index’ , ‘table’ , ‘column’ , ‘all’
For example:
sp_iqworkmon  ‘start’ , ‘all’ 
If one argument is specified, it can only be action. For example:
sp_iqworkmon  ‘stop’ 

Permissions

DBA authority required. Users without DBA authority must be granted EXECUTE permission to run the stored procedure.

Usage

Parameters

Parameter

Description

action

Specifies the control action to apply. A value of start starts monitoring for the specified mode immediately. A value of stop stops monitoring immediately. A value of status (the default) displays the current status without changing state.

The statistics are persisted until they are cleared with the reset argument, or until the server is restarted. Statistics collection does not automatically resume after a server restart, and it needs to be restarted using start.

mode

Specifies the type of monitoring to control. The INDEX, TABLE, and COLUMN keywords individually control monitoring of index usage, table usage, and column usage respectively. The default ALL keyword controls monitoring of all usage monitoring features simultaneously.

There is always a result set when you execute sp_iqworkmon. If you specify a specific mode (such as index), only the row for that mode appears.

Usage is collected only for SQL statements containing a FROM clause; for example, SELECT, UPDATE, and DELETE.

sp_iqworkmon columns

Column name

Description

MonMode

Table, index, or column

Status

Started or stopped

Rowcount

Current number of rows collected

Example

Sample output from the sp_iqworkmon procedure:

MonMode     Status      Rowcount index       started     15 table       started     10 column      started     31

Related reference
sp_iqcolumnuse Procedure
sp_iqindexadvice Procedure
sp_iqindexuse Procedure
sp_iqtableuse Procedure
sp_iqunusedcolumn Procedure
sp_iqunusedindex Procedure
sp_iqunusedtable Procedure