Showing posts with label globals. Show all posts
Showing posts with label globals. Show all posts

Sunday, March 25, 2012

@@CPU_BUSY stops incrementing and generates "Arithmetic overflow occurred"

I am using several globals including @.@.CPU_BUSY to log the performance of some stored procedures. It works fine on my dev server, but in production the value reported by @.@.CPU_BUSY on my production server has stopped at 134217727. And when I try to assign its value to a variable, it always generates an error.

For example:

DECLARE @.FOO BigInt
Set @.foo = @.@.CPU_BUSY
print @.Foo


generates

Arithmetic overflow occurred.
134217727

Note that

DECLARE @.FOO BigInt
Set @.foo = 134217727
print @.Foo


works fine.

I understand that when the value of @.@.CPU_BUSY reaches a certain point, its value becomes inaccurate according to MSDN TSQL Reference. I've also seen some descriptions that say the value is supposed to "wrap" back to zero.

So the questions are:
Is the value of @.@.CPU_BUSY supposed to wrap back to zero when it overflows?
Is there a better/more reliable way to do this?

Cheers,
Jeff
by the way:
Select @.@.version
Microsoft SQL Server 2000 - 8.00.760 (Intel X86)
Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation
Enterprise Edition on Windows NT 5.0 (Build 2195: Service Pack 4)sql

@@Connection

When I use TSQL Debugger it will open three windows... I wanna ask about the
second windows. it gave me output like that
Name (Globals) Value (Globals) Type
(Globals)
@.@.connections 38
int
@.@.transcount 0
int
I only trying to debug on stored procedure and it's giving me @.@.connection =
38.. can any one explain me...
Thanks
@.@.connections is the total number of connection attempts
since SQL Server last started. It's not the number of users
but rather the connections. You can find more information in
books online under: @.@.connections
-Sue
On Thu, 24 Mar 2005 13:50:06 -0500, "John"
<naissani@.hotmail.com> wrote:

>When I use TSQL Debugger it will open three windows... I wanna ask about the
>second windows. it gave me output like that
>
>Name (Globals) Value (Globals) Type
>(Globals)
>@.@.connections 38
>int
>@.@.transcount 0
>int
>
>I only trying to debug on stored procedure and it's giving me @.@.connection =
>38.. can any one explain me...
>Thanks
>
|||Thanks sue...
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:74t641phrlih05ei5eqrkp1bnlg1u25g8h@.4ax.com... [vbcol=seagreen]
> @.@.connections is the total number of connection attempts
> since SQL Server last started. It's not the number of users
> but rather the connections. You can find more information in
> books online under: @.@.connections
> -Sue
> On Thu, 24 Mar 2005 13:50:06 -0500, "John"
> <naissani@.hotmail.com> wrote:
the[vbcol=seagreen]
@.@.connection =
>