update 表 set 字段=right('00'+字段,5)

解决方案 »

  1.   

    update tab1 set date1='0'+date1 where left(date1,patindex('%:%',date1)-1)<10
      

  2.   

    update 表 set 字段 = '0' + 字段
    where cast(substring(字段,1,CHARINDEX(':',字段)) as int) < 10
      

  3.   

    --字符的值是否规范,即除小时外的值,都是规范的两位?update 表 set 字段=convert(char(5),cast(字段 as datetime),108)
      

  4.   

    --或者:
    update 表 set 字段='0'+字段
    where charindex(':',字段)=2
      

  5.   

    update 表 set 字段='0'+字段
    where charindex(':',字段)=2
    ------------------
    这个强