# Database Discussions > MS SQL Server 7/MS SQL Server 2000 >  left pad zeros to integer field

## bobburt

I have an integer field that ranges from 3 to 6 numbers and I need to left pad leading zeros so the field is always a char(7).  What is the syntax to do this?  Thanks in advance.

0001234
0012345
0123456
1234567

----------


## YuckFou

select right('000000'+convert(varchar(7),1234),7)

result:        
------- 
0001234

----------

