User Rating: 0 / 5

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

BEGIN
  DECLARE @CpuBusy INT;
  DECLARE @Idle    INT;
  --
  SET @CpuBusy = @@CPU_BUSY;
  SET @Idle    = @@IDLE ;
  --
  WAITFOR DELAY '00:00:00:500'
  --
  SELECT CONVERT(DECIMAL(4,2), (@@CPU_BUSY - @CpuBusy) /
                               (((@@IDLE - @Idle) + (@@CPU_BUSY - @CpuBusy)) * 1.00)
                                * 100) AS [SQLCpuUtilization];
END;

 

0
0
0
s2sdefault