Prefixing a Numeric Value with Zeros : Right « String Functions « SQL Server / T-SQL Tutorial






RIGHT (REPLICATE ('0', 10) + CAST (qty AS varchar (10)), 10)
12.16.Right
12.16.1.RIGHT return a number of characters from the right-hand side of a string.
12.16.2.Prefixing a Numeric Value with Zeros
12.16.3.Taking the Rightmost Part of a String
12.16.4.Padding a number for business purposes with right