Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Arithmetic overflow error converting numeric to data type numeric.

$
0
0

Hi 
I have a below scenario,

DECLARE @zero_num numeric(5,4)
SET @zero_num = 0.00

SELECT colA,colB,@Zero_num as ratio ,colC into #tmp
FROM table
UPDATE #tmp
SET ratio = colA/ colb WHERE colC 0

Select * from #tmp

when we divide colA and ColB and assign to ratio columm iam getting overflow error because the output of the division was 248.9787565454656 .

So can you please suggest a work around.Iam using sql server 2008 R2.Thanks in advance


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>