title: SQL to html using XML?
body: <p>ok here is what im trying to do I have an sql query within a ssis package that I need to transform into html for storing into an sql table field varbinary(max)</p>
  
  <p>here is the source table (simplified):</p>
  
  <p><p>
      <kbd>Customer ID</kbd>
      <kbd>Question&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</kbd>
      <kbd>Answer</kbd>
      <br>
     <kbd>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</kbd>
      <kbd>how are you?</kbd>
      <kbd>ok&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</kbd><br>
      <kbd>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</kbd>
      <kbd>like beans?&nbsp;&nbsp;&nbsp;&nbsp;</kbd>
      <kbd>mm yes</kbd>
      <br>    <kbd>2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</kbd>
      <kbd>how are you?</kbd>
      <kbd>fine&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</kbd><br>
      <kbd>2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</kbd>
      <kbd>like beans?&nbsp;&nbsp;&nbsp;&nbsp;</kbd>
      <kbd>yuk&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</kbd></p>
  
  <p>The output ideally needs to be:<br>
      <p>
      <kbd>CustomerID</kbd>
      <kbd>html&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</kbd>
      <br>
      <kbd>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</kbd>
      <kbd>see below</kbd><br>
  <kbd>2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</kbd>
      <kbd>see below</kbd></p>
  
  <p>where the html is the table of the questions / answers converted to varbinary(max) grouped by customerID. Thinking of using for xml or something like that but super stuck on this. Help much appreciated.<br></p>
  
  <pre><code>&lt;table&gt;
  &lt;tr&gt;
  &lt;th&gt;Question&lt;/th&gt;
  &lt;th&gt;Answer&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;How are you?&lt;/td&gt;
  &lt;td&gt;ok&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;like beans?&lt;/td&gt;
  &lt;td&gt;mm yes&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>