Just to clarify, you want to retrieve a number and pad it with leading zeros to ensure the value returned is always 9 characters long ?
If so then maybe you could do something like:
DECLARE @Number int
SET @Number = 1
SELECT RIGHT('000000000' + CAST(@Number AS varchar),9) AS Formatted