title: TSQL/MSSQL Select - zero fill integer
body: <p>I have an SQL select statement:</p>
  
  <pre><code>select pk from items
  </code></pre>
  
  <p>it returns:</p>
  
  <pre><code>1
  2
  4
  29
  8
  987654
  12313232
  </code></pre>
  
  <p>Now my boss wants something like:</p>
  
  <pre><code>000001
  000002
  000004
  000029
  000008
  987654
  12313232
  </code></pre>
  
  <p>He definitely want the output to be six digits minimum (which I think nonsense).</p>
  
  <p>I've tried doing something like <code>'00000' + convert(nvarchar(6),pk)</code> which works okay only if the <code>pk</code> is just one digit. Do you have any idea how to do this? Should I use conditional statement? </p>