I am trying to understand data types more..here are few examples which are still puzzling me.
Decimal(p,s)--p is the total digits,s is number of digits after point
So given below example
declare @st decimal(38,38)
set @st=1.22121065111115211641641651616511616
I am getting below error..
Arithmetic overflow error converting numeric to data type numeric
len(digits) after point is 35,total digits including . are 37 ...shouldn't my decimal of (38,38) work
So my question is why i am getting the above error
Here is my research so far..
How do I interpret precision and scale of a number in a database?
Decreasing scale like below works..
declare @st decimal(38,37)
set @st=1.22121065111115211641641651616511616
Answer by boumbh points out an out of range error,but i am not getting error for same example