tags:

views:

217

answers:

1

Why does

select avg(cast(5 as numeric(15,2))) 

returns "Arithmetic overflow error converting numeric to data type numeric."?

Documentation states the following about the avg function:

input: decimal category (p, s)

output: decimal(38, s) divided by decimal(10, 0)

I don't really see how it would overflow.

A: 

Found out the problem:

Database Properties > Options > Numeric Round-Abort was ON.

When set to off the query executed with success.

Arborend
How did this get set "ON"?
gbn