I have a column with text in the following format...
sweet shop
is there a way to convert this directly to it's corresponding text in sql server? (it is actually a linked ms access database so I could also use access too!)
(I think this format is also called Numeric character reference and contains the code points of unicode characters)
Alex K is 99.99% correct, however the conversion would fail if you had Named Codes like
or £
So, here we perform a brute force replace, and then parse the string via XML
Example
Returns
Here is a much easier way to decode HTML-encoded strings:
It requires SQLHTTP which is a free database/assembly that we created which you can find on our website at: http://sqlhttp.net/documentation/encoding/htmldecode/
SELECT SQLHTTP.net.HtmlDecode('sweet shop')
and the result is as expected:
------------- sweet shop (1 row affected)