December 3, 2010 at 2:12 pm
I'm running a query like this
select sum(signal_wait_time_ms) as signal_waits_time_ms
,CAST(100* (signal_wait_time_ms/sum(wait_time_ms as numeric(20,2)))) as %signal_cpu_waits
,sum((wait_time_ms-signal_wait_time_ms))as resource_wait_time_ms
,cast(100*(sum(wait_time_ms-signal_wait_time_ms)/sum(wait_time_ms)as numeric(20,2))) as '%resource waits'
from sys.dm_os_wait_stats
GO
I'm getting the error:
Msg 195, Level 15, State 10, Line 2
'sum' is not a recognized built-in function name.
I used to use it before it works fine in 2005 but when I try in 2008 version
I'm getting this error
Suggest me.
Sql Server 2008 Edition.
December 3, 2010 at 3:20 pm
select sum(signal_wait_time_ms) as signal_waits_time_ms
,CAST(100* (sum(signal_wait_time_ms)/sum(wait_time_ms)) as numeric(20,2)) as [%signal_cpu_waits]
,sum(wait_time_ms-signal_wait_time_ms) as [resource_wait_time_ms]
,cast(100*(sum(wait_time_ms-signal_wait_time_ms)/sum(wait_time_ms)) as numeric(20,2)) as ['%resource waits']
from sys.dm_os_wait_stats
December 3, 2010 at 4:31 pm
December 5, 2010 at 9:25 pm
I added a SUM in the second line and corrected the wrongly placed brackets.
December 6, 2010 at 3:24 pm
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply