title: SQL Server : add characters to a column
body: <p>I have problem with getting SQL code: in a column I have a value with 5 or 6 characters before that values I need put character :0 and value in column must have 7 characters. </p>
  
  <pre><code>Column
  ------
  123456           
  123456
  12345
  12345
  123456
  </code></pre>
  
  <p>This is my code which does not work (I am using SQL Server):</p>
  
  <pre><code>Update table
  set column = CONCAT( '0',  ( column ) )
  where LEN( + RTRIM ( column ) )  &lt; 7
  
  Update table
  set column = CONCAT( '0', RTRIM ( column ) )
  where LEN( RTRIM( column ) ) &lt; 7
  
  UPDATE table
  SET column = '0' + column
  WHERE LEN(column) = 7
  </code></pre>
  
  <p>My result : after my attempt, I get <code>0</code> before values but somewhere still 0 missing.</p>
  
  <pre><code>Column
  -------
  0123456           
  0123456
  012345
  012345
  0123456
  </code></pre>
  
  <p>I need :</p>
  
  <pre><code>Column
  -------
  0123456           
  0123456
  0012345
  0012345
  0123456
  </code></pre>
  
  <p>Thanks for updating my code</p>