Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
gangadhara.ms
Aged Yak Warrior
549 Posts |
Posted - 2011-06-06 : 00:50:08
|
Hi All,I have table with the column nvarchar(max) and i am usign below statement to convert it into numeric and append % symbol to it.CONVERT(VARCHAR(4),CONVERT(INT,ROUND(CAST("[Measures].[MTH Chg%]" AS DECIMAL(4,2)), 0))) + '%' Pls help me.Thanks,Gangadhara MSSQL Developer and DBA |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2011-06-06 : 01:38:45
|
Your column has some data that can't be converted to numeric.--Gail ShawSQL Server MVP |
 |
|
lappin
Posting Yak Master
182 Posts |
Posted - 2011-06-06 : 07:20:58
|
Find the non- numeric rows:SELECT *FROM tableNameWHERE ISNUMERIC(columnName)<> 1 |
 |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2011-06-06 : 09:08:11
|
Be careful. ISNUMERIC can (and does) return 1 for values that cannot cast to Numeric.--Gail ShawSQL Server MVP |
 |
|
|
|
|