SQL Server: Convert varchar to decimal (with considering exponential notation as well)
问题 I need to convert data of a table and do some manipulation. One of the column datatypes is Varchar , but it stores decimal numbers. I am struggling to convert the varchar into decimal . I have tried CAST( @TempPercent1 AS DECIMAL(28, 16)) Problem is that data also has some values in exponential notation, for example: 1.61022e-016 . The sql query is throwing error on encountering such value. The error is Error converting data type varchar to numeric. How should I handle exponential notation