all groups > sql server connect > august 2006 >
You're in the

sql server connect

group:

Server: Msg 8115


Re: Server: Msg 8115 Arnie Rowland
8/16/2006 2:05:09 PM
sql server connect:
The product of ( @qty2 * @qty3 ) is too large to fit in the defined size of
@qty3.

Increase the scale of @qty3.

--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc

Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous


[quoted text, click to view]

RE: Server: Msg 8115 Hari Prasad
8/16/2006 2:11:03 PM
Hi,

This error is something to do with your variable declaration or column width.
So for few values you wont get error.

See the below example:-

select cast(round(10000000.125023343432,2) as decimal(6,2))

Server: Msg 8115, Level 16, State 8, Line 1
Arithmetic overflow error converting numeric to data type numeric.
You need at least a decimal(11,2) for that value. The largest value that a
decimal(8,2) can represent is 9999.99 .

select cast(round(10000000.125023343432,2) as decimal(10,2))

Thanks
Hari
SQL Server MVP

[quoted text, click to view]
Server: Msg 8115 <Preacher Man>
8/16/2006 3:57:56 PM
I am experiencing an error message when I run a TSQL and I don't know how to
correct it.

Server: Msg 8115, Level 16, State 8, Line 38
Arithmetic overflow error converting numeric to data type numeric.

In this code I am extracting hierarchical information. I am going 6 levels
deep. The statement that is giving me the problem is for example at level
3.
Select @qty3=@qty2*@qty3

@qty2 is the Qty from the parent level.

The mystery is that it does not always return an error. And to add to the
mystery my information that is being pulled seems perfectly correct.

Any ideas?

Re: Server: Msg 8115 Aaron Bertrand [SQL Server MVP]
8/16/2006 5:10:37 PM
Can you show the variable declarations, and sample data that causes the
problem?

I can reproduce easily with:




DECLARE
@qty2 NUMERIC(5,3),
@qty3 NUMERIC(5,3);

SET @qty2 = 10.001;
SET @qty3 = 10.002;

SET @qty3 = @qty2 * @qty3;



Followups set to microsoft.public.sqlserver.programming only. Not sure what
this has to do with clients/connect/server.



[quoted text, click to view]

AddThis Social Bookmark Button