select right('00'+cast(字段名 as varchar(2)),2) from 表

解决方案 »

  1.   

    select right('0'+cast(字段名 as varchar(2)),2) from 表
      

  2.   

    declare @你的变量
    set @你的变量=1select right(100+@你的变量,2)
      

  3.   

    select right('00'+cast(字段名 as varchar(2)),2) from 表
      

  4.   

    select right('0'+cast(字段名 as varchar),2) from tablename
      

  5.   

    declare @n int,@nstr varchar(10)
    select @n=2
    select @nstr=convert(varchar(10),@n)
    print case  when len(@nstr)=1 then '0'+@nstr else @nstr end