If you really must:
DECLARE @i int; Set @i = 1;
WHILE @i <= 10
BEGIN
PRINT RIGHT('00000000' + cast(@m as char(9)), 9);
SET @i = @i + 1;
END
But please don't. Data should be stored raw, and only formatted at display time, preferably by the client application.