Category: SQL 2008 R2 Express Hosting

SQL Hosting :: How to Remove Special Characters from a String?

The following summarizes the SQL code to remove Special Characters from a STRING. CREATE FUNCTION dbo.RemoveSpecialChars ( @InputString VARCHAR(8000) ) RETURNS VARCHAR(8000)   BEGIN     IF @InputString IS NULL         RETURN NULL     DECLARE @OutputString VARCHAR(8000)     SET @OutputString = ”     DECLARE @l INT     SET @l = LEN(@InputString)     DECLARE @p INT     SET @p = 1     WHILE @p <= @l         BEGIN             DECLARE @c INT             SET @c = ASCII(SUBSTRING(@InputString, @p, 1))
Read More