title: How to format numeric value when casting to varchar?
body: <p>I have query similar to this:</p>
  
  <pre><code>DECLARE @value decimal(8,0) = 1
  
  SELECT (CAST @value AS varchar(8)) 
  </code></pre>
  
  <p>How can I get output formatted with leading zeros (<code>00000001, 00000023, 00000623</code> etc.)?
  How can I do that?</p>
  
  <p>It is simple task in .Net or Java, but I must do it inside view.</p>