I have this sample table:
Table1
Column1
-------
Hi&Hello
Hello & Hi
Snacks & Drinks
Hello World
Question: in SQL Server, how can I replace all the &
into a character entities (&
) without affecting the existing character entities?
Thanks!
UPDATE Table1 SET Column1 = REPLACE(Column1, '&', '&');
&
or  
in your database.For example:
In php, you can use htmlspecialchars();
In java, you can import static org.apache.commons.lang.StringEscapeUtils.escapeHtml;
and then use escapeHtml();
In ruby on rails, you can use HTMLEntities.new.encode();
(If you use rails3 or newer version, escaping should be done by default.)