I want to convert a varchar(max)
column to decimal(10,4)
.
When I try to use cast
or convert
I am getting an arithmetic overflow exception. The issue is that the data stored in the varchar column may contain different precisions and different scales. For example, 123456789.1234567', 1.12345678 or 123456.1234.
For values like 123456.1234 it is converting with out any issue but for other values I am having some problems.
See Question&Answers more detail:os