I use the query below to convert a column 'Characteristic__c' of varchar(255) into DECIMAL(22,8). The value of Characteristic__c was specified as simply 0.0, but it still cause error 'Arithmetic overflow error converting varchar to data type numeric.'. Don't know the reason and thanks for help.
SELECT CONVERT(DECIMAL(22,8) , Characteristic__c) FROM [ODS].[dbo].
[Scorecard_Details__c]
WHERE Attribute__c='Employment Duration' and Characteristic__c=0.0 and
WOE__c=0
varchar(255)must be too wide to fit intodecimal(22, 8). Just because a given value is0.0does not mean that the space it takes up reflects that amount. - Tim Biegeleisenselect 1 from (values('1')) t(a) where t.a = 0.0;. The fix probably depends on what your data looks like. - ZLK