Better way is create an
User defined function[
^] with those many
Replace
s & ans use it in your SQL
SELECT
statement
EDIT
CREATE FUNCTION Fn_Phone
(
@OffPhoneNo VARCHAR(100)
)
RETURNS VARCHAR(100)
AS
BEGIN
RETURN(LTRIM(RTRIM(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(@OffPhoneNo,' ',''),'.',''),'-',''),'+',''),'(',''),')',''),CHAR(9),''))))
END
Now use it in
SELECT
statement
SELECT OffPhoneNo, dbo.FnPhone(OffPhoneNo) FROM [TableName]