I want to include/modify in my SQL code to be able to eliminate the following characters: '&% -single quotes -ampersand -percentage
I need to include any of this characters in the current REGEX. Thanks in advance
DECLARE @counter int;
SET @counter = 0
WHILE(@counter < (SELECT MAX(ID_COLUMN) FROM [dbo].[zzIntegriyCheckV4HistoryClient_TEMP]))
BEGIN
IF EXISTS (SELECT * FROM [dbo].[zzIntegriyCheckV4HistoryClient_TEMP] WHERE MESSAGE NOT LIKE '% must be between %')
WHILE 1 = 1
BEGIN
DECLARE @RetVal varchar(50)
SET @RetVal = (SELECT MESSAGE = STUFF(MESSAGE, PATINDEX('%[0-9()$%&/.:!]%', MESSAGE),1, '')
FROM [dbo].[zzIntegriyCheckV4HistoryClient_TEMP]
WHERE ID_COLUMN = @counter)
IF(@RetVal IS NOT NULL)
UPDATE [dbo].[zzIntegriyCheckV4HistoryClient_TEMP] SET MESSAGE = @RetVal WHERE ID_COLUMN = @counter
ELSE
break
END
SET @counter = @counter + 1
END