When you say, "convert it to a number", what do you mean? There are several number types in SQL Server. There float, real, decimal/numeric, money, int, bigint, etc...
-George
Microsoft SQL Server MVP My Blogs SQLCop twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
I don't get an error when I run your example value:
Code:
Declare @Blah varchar(20)
Set @Blah = '0.857142857142857'
Select Convert(float, @Blah)
Therefore, I assume there are values in this varchar(20) column that cannot be converted to a number. For example, if you had the value [!]'Seven'[/!], you would get a conversion error. To find these bad values, run the following query.
Code:
Select YourColumnName
From YourTable
Where IsNumeric(YourColumnName) = 0
-George
Microsoft SQL Server MVP My Blogs SQLCop twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.