This command starts the monitor. If the monitor is not running, the Query Status agent starts. Stopping the agent also stops the monitor.
sp_configure "enable monitoring",1 go
This command stops the monitor
sp_configure "enable monitoring",0 go