I would like to create a function that will be passed in quite a lot of text and which will replace any single and/or double quotes with the html value for them. I have tried the code below but I get an error in compiling it....
I am not sure what I am doing wrong. Any help would be much appreciated.
DECLARE @X nvarchar(100)
DECLARE @MyText nvarchar(100)
SET @MyText = 'he's not "very" good'
SET @X = REPLACE(@MyText,'"','"')
SET @X = REPLACE(@X,'''''',''')