The simplest way is to use format()
function
select format(CLASS,'0000') as CLASS,
format(VENDOR,'00000') as VENDOR,
format(STYLE,'0000') as STYLE,
format(COLOR,'000') as COLOR,
format(SIZE,'0000') as SIZE
from mytable
If you want to show 00000 instead of nulls then :
select format(coalesce(CLASS,0),'0000') as CLASS,
format(coalesce(VENDOR,0),'00000') as VENDOR,
format(coalesce(STYLE,0),'0000') as STYLE,
format(coalesce(COLOR,0),'000') as COLOR,
format(coalesce(SIZE,0),'0000') as SIZE
from mytable
So the String of length 20 characters with preceding zero could be :
select format(coalesce(CLASS,0),'0000') +
format(coalesce(VENDOR,0),'00000') +
format(coalesce(STYLE,0),'0000') +
format(coalesce(COLOR,0),'000') +
format(coalesce(SIZE,0),'0000') as CONCATENAD
from mytable
Demo here