Search notes:

SQL Server function: round

Arithmetic overflow error… ?!

I believe only SQL Server is able to produce an error message when trying to round 0.5:
select round(0.5, 0)
-- Msg 8115, Level 16, State 2, Line 15
-- Arithmetic overflow error converting expression to data type numeric.
In order to prevent this error, the third parameter needs to be set to 1 (which also causes the result to be rounded down!):
select round(1.5, 0, 1)
--
-- 0.0

Index