How to convert letters used in phone numbers into digits, i.e. input string '1-800-FLOWERS' should return '1-800-3569377', using a T-SQL? In Oracle, I would have used PL/SQL TRANSLATE function, however I need to do it in T-SQL and there is no similar function in T-SQL.
Please take a look at this image - this is the transformation I am looking for Thanks!
Here is my solution:
dbo.Translatefunction by running a T-SQL script from this answer
select dbo.Translate('1-800-FLOWERS', 'abcdefghijklmnopqrstuvwxyz', '22233344455566677778889999') ------------------------- 1-800-3569377 (1 row(s) affected)