• SELECT CreditCardID,

    right('00000000000' + cast (CreditCardID as varchar(10)), 10)

    AS ProductionIDColumn

    FROM Sales.CreditCard

    I just grabbed a random AdventureWorks table to use.

    I cast the number to a string, add 10 zeros to the front, the grab the last 10 characters. This will always be a 10 char long string, with preceding zeros added to the number. Change the number of chars and the digit, to change the number of chars.

    Look to your right when posting, there's a ton of tags there you use. They use square brackets, just to be difficult 🙂