国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數(shù)據(jù)庫 > SQL Server > 正文

SQL Server中取漢字拼音的函數(shù)

2024-08-31 00:49:49
字體:
供稿:網(wǎng)友

create  function fun_getpy
 (
    @str nvarchar(4000)
 )
returns nvarchar(4000)
as
begin
  declare @word nchar(1),@py nvarchar(4000)

  set @py=''

  while len(@str)>0
  begin
    set @word=left(@str,1)

    --如果非漢字字符,返回原字符
    set @[email protected]+(case when unicode(@word) between 19968 and 19968+20901
               then ( 
                            select top 1 py 
                            from 
                            ( 
                             select 'a' as py,n'驁' as word
                             union all select 'b',n'簿'
                             union all select 'c',n'錯'
                     union all select 'd',n'鵽'
                     union all select 'e',n'樲'
                     union all select 'f',n'鰒'
                     union all select 'g',n'腂'
                     union all select 'h',n'夻'
                     union all select 'j',n'攈'
                     union all select 'k',n'穒'
                     union all select 'l',n'鱳'
                     union all select 'm',n'旀'
                     union all select 'n',n'桛'
                     union all select 'o',n'漚'
                     union all select 'p',n'曝'
                     union all select 'q',n'囕'
                     union all select 'r',n'鶸'
                     union all select 's',n'蜶'
                     union all select 't',n'籜'
                     union all select 'w',n'鶩'
                     union all select 'x',n'鑂'
                     union all select 'y',n'韻'
                     union all select 'z',n'咗'
                      ) t 
                   where word>[email protected] collate chinese_prc_cs_as_ks_ws 
                   order by py asc
                          ) 
                      else @word 
                 end)
    set @str=right(@str,len(@str)-1)
  end

  return @py

end

請作者聯(lián)系本站,及時附注您的姓名。聯(lián)系郵箱:edu#chinaz.com(把#改為@)。


發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 伊金霍洛旗| 容城县| 县级市| 额敏县| 辉南县| 星座| 灵山县| 长春市| 寻甸| 融水| 乡宁县| 泗水县| 安徽省| 十堰市| 托克逊县| 城步| 甘肃省| 凤台县| 洛阳市| 巴彦淖尔市| 裕民县| 凤台县| 清流县| 顺义区| 即墨市| 措勤县| 宁海县| 常宁市| 炉霍县| 安龙县| 阜康市| 南投县| 潞城市| 井研县| 桂阳县| 泰顺县| 台前县| 福海县| 贺兰县| 庄河市| 凤阳县|