title: FOR XML could not serialize the data for node because it contains a character (0x0001) which is not allowed in XML
body: <p>I am trying to use FOR XML for the first time in T-SQL on SQL Server 2008. I am getting this error message for one of the columns in my big table:</p>
  
  <pre><code>FOR XML could not serialize the data for node because it contains a character (0x0001) which is not allowed in XML. To retrieve this data using FOR XML, convert it to binary, varbinary or image data type and use the BINARY BASE64 directive.
  </code></pre>
  
  <p>I took a guess and tried this:</p>
  
  <pre><code>select * from db.dbo.table where colThatGeneratedError like '%0x0001%'
  </code></pre>
  
  <p>but it pulls no rows.</p>
  
  <p>How can I find out what row in the table contains the invalid characters?</p>
  
  <p>What character does 0x0001 refer to? To my eye that looks like hex for 1 = decimal 1 </p>