Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

SQL query always show 0.0000 when pulling the CPU usage in Percentage

$
0
0

I am using this query in different servers to pull the CPU usage and its showing accurate results,

only in one server it shows always 0.00000% sql CPU usage

any suggestions how can i resolve this issue

create proc CpuTimeInPercentageForNigeos as begin DECLARE @CPU_BUSY int , @IDLE int SELECT @CPU_BUSY = @@CPU_BUSY , @IDLE = @@IDLE WAITFOR DELAY '000:00:01' SELECT (@@CPU_BUSY - @CPU_BUSY)/((@@IDLE - @IDLE + @@CPU_BUSY - @CPU_BUSY) * 1.00) *100 AS CPUBusyPct end go



k




Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>