• Actually, it's not something easily done from SQL Server and probably should not be. It should be done from Windows. Here's a link about setting up such alerts from Windows.

    http://www.windowsnetworking.com/articles-tutorials/windows-2003/Windows_2003_Performance_Monitor.html

    If you insist on doing such a thing from SQL Server, you can try incorporating one of the following into a job.

    SELECT instance_name

    ,[CPU%] = SUM(CASE WHEN counter_name = 'CPU usage %' THEN cntr_value*100.0 ELSE 0.0 END)

    / SUM(CASE WHEN counter_name = 'CPU usage % base' THEN cntr_value ELSE 1.0 END)

    FROM sys.dm_os_performance_counters

    WHERE object_name = 'SQLServer:Resource Pool Stats'

    AND counter_name IN ('CPU usage %','CPU usage % base')

    GROUP BY instance_name

    ;

    EXEC xp_CmdShell 'wmic cpu get loadpercentage'

    ;

    EXEC xp_CmdShell 'typeperf "\processor(_Total)\% Processor Time" -SC 1 -y';

    Keep in mind that those last two methods are "instantaneous values".

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)