Provides command-specific examples for other enhanced commands. The syntax of this command has not changed.
sp_monitor help [, { command | monitoring_type } ]
command – name of a command, such as enable or disable.
monitoring_type – monitoring type such as deadlock or connection. For a complete table of these types see Table 1.
sp_monitor help, enable ---------------------- Usage: sp_monitor 'enable' [, '<type> [monitoring]' Examples: sp_monitor 'enable' Valid monitoring <type> is one of : 'enable' | 'disable' | 'connection' | 'procedure' | 'statement' | event' | 'deadlock' | 'procstack' -- Enable monitoring for a specific type, to monitor statements. sp_monitor enable, statement sp_monitor enable, 'statement monitoring' -- Enable monitoring for connection monitoring sp_monitor enable, connection sp_monitor enable, 'connection monitoring' -- Enable monitoring for all types sp_monitor enable sp_monitor enable, 'all' sp_monitor enable, 'all monitoring'
sp_monitor help, procstack ------------ Usage: sp_monitor 'procstack' [, '<spid>'] [, '<contextbloc>' ] -- Monitor a given spid (that may possibly be in a hung state), and if possible -- generate a back trace of the procedures it is currently executing. sp_monitor 'procstack', '<spid>' -- To generate a procstack of your current connection, with a context block of 10 lines, do: declare @spid_str varchar(5) select @spid_str = convert(varchar, @@spid) exec sp_monitor 'procstack', @spid_str, '10'