title: How to cast a number to string with 0 prefix in sql server
body: <p>In sql server, if I have a number <code>n</code>, and <code>n&gt;=0 and n&lt;=100</code>, how to cast it into a string with sql?</p>
  
  <pre><code>1 =&gt; '01'
  2 =&gt; '02'
  ...
  10 =&gt; '10'
  99 =&gt; '99'
  </code></pre>
  
  <p>It is something like printf.</p>
  
  <pre><code>printf ('%2d", n);
  </code></pre>