title: < converted to &lt; in sql server
body: <p>i have some data in my table</p>
  
  <p>when i select that data with this query</p>
  
  <pre><code>select TblActionHistories.Comments from TblActionHistories WHERE TblActionHistories.Entity=CAST('Task' AS VARCHAR) AND EntityId=CAST(32 AS VARCHAR)
  </code></pre>
  
  <p>it's coming fine like this</p>
  
  <pre><code>Task- &lt;b&gt;T1&lt;/b&gt; has been added by Swapnil Sharma
  Task- &lt;b&gt;T1&lt;/b&gt; status changed to &lt;b&gt;In Progress&lt;/b&gt; by Swapnil Sharma&lt;br/&gt;
  </code></pre>
  
  <p>but now i want my above result # separated using <code>stuff</code> so i am using this</p>
  
  <pre><code>SELECT STUFF((SELECT '#' + ISNULL(CAST(TblActionHistories.Comments AS VARCHAR(MAX)),'') FROM TblActionHistories WHERE TblActionHistories.Entity=CAST('Task' AS VARCHAR) AND EntityId=CAST(32 AS VARCHAR) for xml path ('')),1,1,'')
  </code></pre>
  
  <p>it gives me this </p>
  
  <pre><code>Task- &amp;lt;b&amp;gt;T1&amp;lt;/b&amp;gt; has been added by Swapnil Sharma#Task- &amp;lt;b&amp;gt;T1&amp;lt;/b&amp;gt; status changed to &amp;lt;b&amp;gt;In Progress&amp;lt;/b&amp;gt; by Swapnil Sharma&amp;lt;br/&amp;gt;
  </code></pre>
  
  <p>you can clearly see that all the special char. like &lt; > converted to <code>&amp;lt; &amp;gt;</code> respectively</p>
  
  <p>please help me out with this i want them to come in their original format </p>