title: Add zeros to front of column
body: <p>I have a column that is a maximum size of 9 characters and I want to do a query that will look at all rows which are less than 9. This:</p>
  
  <pre><code>SELECT *
  FROM tEmpCourseAssoc
  WHERE ({ fn LENGTH(EmployeeID) } &lt; 9)
  </code></pre>
  
  <p>Now I want to add zeros to the front of the column EmployeeID if it's less than 9 characters so it adds up to nine characters. For example if the column EmployeeID is 1234567 it would get updated to 001234567 and if it's 12345678 it would get updated to 012345678</p>
  
  <p>I think it's something like:</p>
  
  <pre><code>SELECT RIGHT('0000000' + CAST(myField AS VARCHAR), 9)
  </code></pre>
  
  <p>But I'm not sure how to implement this. I plan on excuting the query straight from Enterprise Manager. The column EmployeeID is type varchar(10)</p>