score:3

if Phone_Number has any alphabetic or symbol characters it will fail when CASTing it to DECIMAL:

Update table set Test = Convert(varchar(53), Cast(Phone_Number as Decimal))
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Your question is very vague, but you could try:

Update YourTable
    SET Test=CASE 
                 WHEN ISNUMERIC(Phone_Number)=1 THEN Convert(varchar(53), Cast(Phone_Number as Decimal)) --this is your code unchanged
                 ELSE Phone_Number
             END
...

More questions

More questions with similar tag