DECLARE @str VARCHAR(400)
DECLARE @expres VARCHAR(5 0) = '%[~,@,#,$,%,&,*,(,),.,!] %'
SET @str = '(remove) ~special~ *characters. from string in sql!'
WHILE PATINDEX( @expres, @str ) > 0
SET @str = Replace(R EPLACE( @str, SUBSTRING( @str, PATINDEX( @expres,@str ), 1 ) ,''),'-',' ')
SELECT @str
No comments:
Post a Comment