I'm not sure, does that work if the number is 143? Would 00143 be returned or 00000143? @Jordan: Google-search for "Sql Server padding function" to see implementations of lpad and rpad. Seems the usually use replicate and len.
–
FrustratedWithFormsDesignerJan 11 '11 at 18:30

1

@Frustrated - No it only takes the 5 rightmost chars after the concatenation.
–
Martin SmithJan 11 '11 at 18:32

1

@FrustratedWithFormsDesigner, Yes, it will work for 143 and any number up to 99999. I chose the 5-digit presentation because I saw that format in the question. The replicate and len will work as well.
–
bobsJan 11 '11 at 18:33