I am a novice user to sql and need help buidling this stored proc I am working on. One of the values that I pass through my stored proc is ClassCodeGroup and sometimes its less than 10. How do I check if its less than 10 in sql ? If its less than 10 (1-9) then I want to add a leading 0 to it which I am thinking should be something like this.
select RIGHT('0' + convert (varchar(50), @ClassCodeGroup),2)
Any help would be greatly appreciated! Thanks