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!
&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 useescapeHtml();In ruby on rails, you can use
HTMLEntities.new.encode();(If you use rails3 or newer version, escaping should be done by default.)