Controls collection of workload monitor usage information, and reports monitoring collection status. sp_iqworkmon collects information for all SQL statements.
sp_iqworkmon [ ‘action’ ] [ , ‘mode’ ]
action = ‘start’ , ‘stop’ , ’status’ , ‘reset’
mode = ‘index’ , ‘table’ , ‘column’ , ‘all’
sp_iqworkmon ‘start’ , ‘all’
sp_iqworkmon ‘stop’
You must have EXECUTE privilege on the system procedure, as well as the MONITOR system privilege.
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.
Column name |
Description |
---|---|
MonMode |
Table, index, or column |
Status |
Started or stopped |
Rowcount |
Current number of rows collected |