title: SQL cast() INT to CHAR not working in UPDATE query
body: <p>I am trying to retroactively add sequencing information to my SQL database by setting the default order equal to the <code>ID</code> which is currently present. The <code>ID</code> column is an <code>INT</code> and the <code>sequence</code> column is <code>TEXT</code>. </p>
  
  <p>I want the <code>sequence</code> column to be in the following format: <code>["1", "1", "1"]</code></p>
  
  <p>The following works: </p>
  
  <pre><code>UPDATE products p
  SET  p.sequence =  p.id
  </code></pre>
  
  <p>For some reason, whenever I get a query to work (even with <code>cast()</code>), it adds the values instead of concatenating them... </p>
  
  <p>For instance, I have tried: </p>
  
  <pre><code>UPDATE products p 
  SET p.sequence = cast(p.id as char(10))+cast(p.id as char(10))
  </code></pre>
  
  <p>And the <code>sequence</code> columns all change to the value of <code>id</code>+<code>id</code>, e.g. ID = 1, sequence = 2...</p>
  
  <p>Then if I try: </p>
  
  <pre><code>UPDATE products p
  SET  p.sequence =  '["'+p.id+'", "'+p.id+'", "'+p.id+'"]'
  </code></pre>
  
  <p>Result: The values of <code>sequence</code> are now three times the value of <code>ID</code>, i.e. ID = 2, sequence = 6. It is adding the IDs instead of concatenating them. </p>
  
  <p>And if I <code>cast()</code> the same query, it says "0 Rows affected": </p>
  
  <pre><code>UPDATE products p
  SET  p.sequence =  '["'+cast(p.id as char(10))+'", "'+cast(p.id as char(10))+'", "'+cast(p.id as char(10))+'"]'
  </code></pre>