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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to convert numeric to alphabets in mssql

Author  Topic 

mohan123
Constraint Violating Yak Guru

252 Posts

Posted - 2012-11-26 : 04:42:10
Hello all,

i am facing small issue in my table i have values and i need to convert while i showing in grid for example i have value 1 and 2 and i need to convert them into ONE AND TWO how to convert is not about cast and convert????

P.V.P.MOhan

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2012-11-26 : 05:36:22
I think there is no direct in-built function for transforming numbers to words...

Anyway check this link to get UDF(User Defined Function)

http://gallery.technet.microsoft.com/scriptcenter/b2be3486-e3d2-4021-a9d8-8337ed428f64

--
Chandu
Go to Top of Page

revdnrdy
Posting Yak Master

220 Posts

Posted - 2012-11-27 : 13:22:36
If you are just looking to transform the data why not just use a case statement?

SELECT ID, Category =
CASE Values
WHEN 'Value 1' THEN 'ONE'
WHEN 'Value 2' THEN 'TWO'
ELSE 'Not found'
END

FROM Sometable
Go to Top of Page
   

- Advertisement -