主键生成器[5]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 lsmxcool 的 blog

               when 1 then '000'+rtrim(ltrim(@tmpprenum))

                when 2 then '00'+ rtrim(ltrim(@tmpprenum))

                when 3 then '0'+  rtrim(ltrim(@tmpprenum))

                when 4 then       rtrim(ltrim(@tmpprenum))

              end

-----------------------------------------------------------------------------------------------------------------

set @year1 =right(ltrim(rtrim((str(year(@prctmpdate ))))),2)                      --取出年份

select @month1=

               case len (ltrim(str(month(@prctmpdate))))                   --取出月份,若不够两位的补够两位

                 when 1 then '0'+ltrim(str(month(@prctmpdate )))

                 when 2 then     ltrim(str(month(@prctmpdate )))

本文关键:主键生成器
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top