I do not have control over what the parameter data contains, the user enters a string [to search for ] as a parameter. if that string has a ' or " the report breaks. so i need a way to scrub the data before the query is run in the command.
I have tried this, but it did not work:
SET @SUBJECT = Replace(@SUBJECT, '''', '''''')
...rest of query...