I use this code to add leading zeroes.
SELECT RIGHT('HL000000'+ CONVERT(VARCHAR(10), @holrefno + 1), 10) AS 'refno'
But when I tested it, let's say I'll make the reference number as 99 it would show up as HL00000100
. I want to keep it as a 10 digit string in my database, could anyone refer me my mistake? Or is there any way I could fix this?
EDIT:
I would like to have an input where the string length will still be 10.