How to add zero in front of numeric value in T-SQL 2005 or 2008?
<p>I have to export a table in fixed format way. When I have numeric field, I have to add leading zeroes. </p>

<p>I know with SQL Server 2012, I can use <code>FORMAT()</code>. How to do in SQL Server 2005? </p>

<p>For instance, in a column with number 18, with fixed length 10, I have to export: </p>

<pre><code>0000000018
</code></pre>