在SQL server 中用sql语句获取汉字全拼的函数

2011-04-22 15:21:22 作者:admin 来源: 浏览次数:0 网友评论 0

 ALTER function [dbo].[f_GetPy](@str varchar(100))
returns varchar(8000)
as
begin
declare @return varchar(8000)
--生成临时表
declare @tb table(chr nchar(1) collate Chinese_PRC_CS_AS_KS_WS,py nvarchar(20)) 
i
 ALTER function [dbo].[f_GetPy](@str varchar(100))
returns varchar(8000)
as
begin
declare @return varchar(8000)
--生成临时表
declare @tb table(chr nchar(1) collate Chinese_PRC_CS_AS_KS_WS,py nvarchar(20)) 
insert into @tb select'吖','a' 
insert into @tb select'厑','aes' 
insert into @tb select'哎','ai' 
insert into @tb select'安','an' 
insert into @tb select'肮','ang' 
insert into @tb select'凹','ao' 
insert into @tb select'八','ba' 
insert into @tb select'挀','bai' 
insert into @tb select'兡','baike' 
insert into @tb select'瓸','baiwa' 
insert into @tb select'扳','ban' 
insert into @tb select'邦','bang' 
insert into @tb select'勹','bao' 
insert into @tb select'萡','be' 
insert into @tb select'陂','bei' 
insert into @tb select'奔','ben' 
insert into @tb select'伻','beng' 
insert into @tb select'皀','bi' 
insert into @tb select'边','bian' 
insert into @tb select'辪','uu' 
insert into @tb select'灬','biao' 
insert into @tb select'憋','bie' 
insert into @tb select'汃','bin' 
insert into @tb select'冫','bing' 
insert into @tb select'癶','bo' 
insert into @tb select'峬','bu' 
insert into @tb select'嚓','ca' 
insert into @tb select'偲','cai' 
insert into @tb select'乲','cal' 
insert into @tb select'参','can' 
insert into @tb select'仓','cang' 
insert into @tb select'撡','cao' 
insert into @tb select'冊','ce' 
insert into @tb select'膥','cen' 
insert into @tb select'噌','ceng' 
insert into @tb select'硛','ceok' 
insert into @tb select'岾','ceom' 
insert into @tb select'猠','ceon' 
insert into @tb select'乽','ceor' 
insert into @tb select'叉','cha' 
insert into @tb select'犲','chai' 
insert into @tb select'辿','chan' 
insert into @tb select'伥','chang' 
insert into @tb select'抄','chao' 
insert into @tb select'车','che' 
insert into @tb select'抻','chen' 
insert into @tb select'阷','cheng' 
insert into @tb select'吃','chi' 
insert into @tb select'充','chong' 
insert into @tb select'抽','chou' 
insert into @tb select'出','chu' 
insert into @tb select'膗','chuai' 
insert into @tb select'巛','chuan' 
insert into @tb select'刅','chuang' 
insert into @tb select'吹','chui' 
insert into @tb select'旾','chun' 
insert into @tb select'踔','chuo' 
insert into @tb select'呲','ci' 
insert into @tb select'嗭','cis' 
insert into @tb select'从','cong' 
insert into @tb select'凑','cou' 
insert into @tb select'粗','cu' 
insert into @tb select'汆','cuan' 
insert into @tb select'崔','cui' 
insert into @tb select'邨','cun' 
insert into @tb select'瑳','cuo' 
insert into @tb select'撮','chua' 
insert into @tb select'咑','da' 
insert into @tb select'呔','dai' 
insert into @tb select'丹','dan' 
insert into @tb select'当','dang' 
insert into @tb select'刀','dao' 
insert into @tb select'恴','de' 
insert into @tb select'揼','dem' 
insert into @tb select'扥','den' 
insert into @tb select'灯','deng' 
insert into @tb select'仾','di' 
insert into @tb select'嗲','dia' 
insert into @tb select'敁','dian' 
insert into @tb select'刁','diao' 
insert into @tb select'爹','die' 
insert into @tb select'哋','dei' 
insert into @tb select'嚸','dim' 
insert into @tb select'丁','ding' 
insert into @tb select'丟','diu' 
insert into @tb select'东','dong' 
insert into @tb select'吺','dou' 
insert into @tb select'剢','du' 
insert into @tb select'耑','duan' 
insert into @tb select'叾','dug' 
insert into @tb select'垖','dui' 
insert into @tb select'吨','dun' 
insert into @tb select'咄','duo' 
insert into @tb select'妸','e' 
insert into @tb select'奀','en' 
insert into @tb select'鞥','eng' 
insert into @tb select'仒','eo' 
insert into @tb select'乻','eol' 
insert into @tb select'旕','eos' 
insert into @tb select'儿','er' 
insert into @tb select'发','fa' 
insert into @tb select'帆','fan' 
insert into @tb select'匚','fang' 
insert into @tb select'飞','fei' 
insert into @tb select'吩','fen' 
insert into @tb select'丰','feng' 
insert into @tb select'瓰','fenwa' 
insert into @tb select'覅','fiao' 
insert into @tb select'仏','fo' 
insert into @tb select'垺','fou' 
insert into @tb select'夫','fu' 
insert into @tb select'猤','fui' 
insert into @tb select'旮','ga' 
insert into @tb select'侅','gai' 
insert into @tb select'甘','gan' 
insert into @tb select'冈','gang' 
insert into @tb select'皋','gao' 
insert into @tb select'戈','ge' 
insert into @tb select'给','gei' 
insert into @tb select'根','gen' 
insert into @tb select'更','geng' 
insert into @tb select'啹','geu' 
insert into @tb select'喼','gib' 
insert into @tb select'嗰','go' 
insert into @tb select'工','gong' 
insert into @tb select'兝','gongfen' 
insert into @tb select'兣','gongli' 
insert into @tb select'勾','gou' 
insert into @tb select'估','gu' 
insert into @tb select'瓜','gua' 
insert into @tb select'乖','guai' 
insert into @tb select'关','guan' 
insert into @tb select'光','guang' 
insert into @tb select'归','gui' 
insert into @tb select'丨','gun' 
insert into @tb select'呙','guo' 
insert into @tb select'妎','ha' 
insert into @tb select'咍','hai' 
insert into @tb select'乤','hal' 
insert into @tb select'兯','han' 
insert into @tb select'魧','hang' 
insert into @tb select'茠','hao' 
insert into @tb select'兞','haoke' 
insert into @tb select'诃','he' 
insert into @tb select'黒','hei' 
insert into @tb select'拫','hen' 
insert into @tb select'亨','heng' 
insert into @tb select'囍','heui' 
insert into @tb select'乊','ho' 
insert into @tb select'乥','hol' 
insert into @tb select'叿','hong' 
insert into @tb select'齁','hou' 
insert into @tb select'乎','hu' 
insert into @tb select'花','hua' 
insert into @tb select'徊','huai' 
insert into @tb select'欢','huan' 
insert into @tb select'巟','huang' 
insert into @tb select'灰','hui' 
insert into @tb select'昏','hun' 
insert into @tb select'吙','huo' 
insert into @tb select'嚿','geo' 
insert into @tb select'夻','hwa' 
insert into @tb select'丌','ji' 
insert into @tb select'加','jia' 
insert into @tb select'嗧','jialun' 
insert into @tb select'戋','jian' 
insert into @tb select'江','jiang' 
insert into @tb select'艽','jiao' 
insert into @tb select'阶','jie' 
insert into @tb select'巾','jin' 
insert into @tb select'坕','jing' 
insert into @tb select'冂','jiong' 
insert into @tb select'丩','jiu' 
insert into @tb select'欍','jou' 
insert into @tb select'凥','ju' 
insert into @tb select'姢','juan' 
insert into @tb select'噘','jue' 
insert into @tb select'军','jun' 
insert into @tb select'咔','ka' 
insert into @tb select'开','kai' 
insert into @tb select'乫','kal' 
insert into @tb select'刊','kan' 
insert into @tb select'冚','hem' 
insert into @tb select'砊','kang' 
insert into @tb select'尻','kao' 
insert into @tb select'坷','ke' 
insert into @tb select'肎','ken' 
insert into @tb select'劥','keng' 
insert into @tb select'巪','keo' 
insert into @tb select'乬','keol' 
insert into @tb select'唟','keos' 
insert into @tb select'厼','keum' 
insert into @tb select'怾','ki' 
insert into @tb select'空','kong' 
insert into @tb select'廤','kos' 
insert into @tb select'抠','kou' 
insert into @tb select'扝','ku' 
insert into @tb select'夸','kua' 
insert into @tb select'蒯','kuai' 
insert into @tb select'宽','kuan' 
insert into @tb select'匡','kuang' 
insert into @tb select'亏','kui' 
insert into @tb select'坤','kun' 
insert into @tb select'拡','kuo' 
insert into @tb select'穒','kweok' 
insert into @tb select'垃','la' 
insert into @tb select'来','lai' 
insert into @tb select'兰','lan' 
insert into @tb select'啷','lang' 
insert into @tb select'捞','lao' 
insert into @tb select'仂','le' 
insert into @tb select'雷','lei' 
insert into @tb select'塄','leng' 
insert into @tb select'唎','li' 
insert into @tb select'俩','lia' 
insert into @tb select'嫾','lian' 
insert into @tb select'簗','liang' 
insert into @tb select'蹽','liao' 
insert into @tb select'毟','lie' 
insert into @tb select'厸','lin' 
insert into @tb select'伶','ling' 
insert into @tb select'溜','liu' 
insert into @tb select'瓼','liwa' 
insert into @tb select'囖','lo' 
insert into @tb select'龙','long' 
insert into @tb select'娄','lou' 
insert into @tb select'噜','lu' 
insert into @tb select'驴','lv' 
insert into @tb select'寽','lue' 
insert into @tb select'孪','luan' 
insert into @tb select'掄','lun' 
insert into @tb select'頱','luo' 
insert into @tb select'呣','m' 
insert into @tb select'妈','ma' 
insert into @tb select'遤','hweong' 
insert into @tb select'埋','mai' 
insert into @tb select'颟','man' 
insert into @tb select'牤','mang' 
insert into @tb select'匁','mangmi' 
insert into @tb select'猫','mao' 
insert into @tb select'唜','mas' 
insert into @tb select'庅','me' 
insert into @tb select'呅','mei' 
insert into @tb select'椚','men' 
insert into @tb select'掹','meng' 
insert into @tb select'踎','meo' 
insert into @tb select'瞇','mi' 
insert into @tb select'宀','mian' 
insert into @tb select'喵','miao' 
insert into @tb select'乜','mie' 
insert into @tb select'瓱','miliklanm' 
insert into @tb select'民','min' 
insert into @tb select'冧','lem' 
insert into @tb select'名','ming' 
insert into @tb select'谬','miu' 
insert into @tb select'摸','mo' 
insert into @tb select'乮','mol' 
insert into @tb select'哞','mou' 
insert into @tb select'母','mu' 
insert into @tb select'旀','myeo' 
insert into @tb select'丆','myeon' 
insert into @tb select'椧','myeong' 
insert into @tb select'拏','na' 
insert into @tb select'腉','nai' 
insert into @tb select'囡','nan' 
insert into @tb select'囔','nang' 
insert into @tb select'乪','keg' 
insert into @tb select'孬','nao' 
insert into @tb select'疒','ne' 
insert into @tb select'娞','nei' 
insert into @tb select'焾','nem' 
insert into @tb select'嫩','nen' 
insert into @tb select'莻','neus' 
insert into @tb select'鈪','ngag' 
insert into @tb select'銰','ngai' 
insert into @tb select'啱','ngam' 
insert into @tb select'妮','ni' 
insert into @tb select'年','nian' 
insert into @tb select'娘','niang' 
insert into @tb select'茑','niao' 
insert into @tb select'捏','nie' 
insert into @tb select'脌','nin' 
insert into @tb select'宁','ning' 
insert into @tb select'牛','niu' 
insert into @tb select'农','nong' 
insert into @tb select'羺','nou' 
insert into @tb select'奴','nu' 
insert into @tb select'女','nv' 
insert into @tb select'疟','nue' 
insert into @tb select'瘧','nve' 
insert into @tb select'奻','nuan' 
insert into @tb select'黁','nun' 
insert into @tb select'燶','nung' 
insert into @tb select'挪','nuo' 
insert into @tb select'筽','o' 
insert into @tb select'夞','oes' 
insert into @tb select'乯','ol' 
insert into @tb select'鞰','on' 
insert into @tb select'讴','ou' 
insert into @tb select'妑','pa' 
insert into @tb select'俳','pai' 
insert into @tb select'磗','pak' 
insert into @tb select'眅','pan' 
insert into @tb select'乓','pang' 
insert into @tb select'抛','pao' 
insert into @tb select'呸','pei' 
insert into @tb select'瓫','pen' 
insert into @tb select'匉','peng' 
insert into @tb select'浌','peol' 
insert into @tb select'巼','phas' 
insert into @tb select'闏','phdeng' 
insert into @tb select'乶','phoi' 
insert into @tb select'喸','phos' 
insert into @tb select'丕','pi' 
insert into @tb select'囨','pian' 
insert into @tb select'缥','piao' 
insert into @tb select'氕','pie' 
insert into @tb select'丿','pianpang' 
insert into @tb select'姘','pin' 
insert into @tb select'乒','ping' 
insert into @tb select'钋','po' 
insert into @tb select'剖','pou' 
insert into @tb select'哣','deo' 
insert into @tb select'兺','ppun' 
insert into @tb select'仆','pu' 
insert into @tb select'七','qi' 
insert into @tb select'掐','qia' 
insert into @tb select'千','qian' 
insert into @tb select'羌','qiang' 
insert into @tb select'兛','qianke' 
insert into @tb select'瓩','qianwa' 
insert into @tb select'悄','qiao' 
insert into @tb select'苆','qie' 
insert into @tb select'亲','qin' 
insert into @tb select'蠄','kem' 
insert into @tb select'氢','qing' 
insert into @tb select'銎','qiong' 
insert into @tb select'丘','qiu' 
insert into @tb select'曲','qu' 
insert into @tb select'迲','keop' 
insert into @tb select'峑','quan' 
insert into @tb select'蒛','que' 
insert into @tb select'夋','qun' 
insert into @tb select'亽','ra' 
insert into @tb select'囕','ram' 
insert into @tb select'呥','ran' 
insert into @tb select'穣','rang' 
insert into @tb select'荛','rao' 
insert into @tb select'惹','re' 
insert into @tb select'人','ren' 
insert into @tb select'扔','reng' 
insert into @tb select'日','ri' 
insert into @tb select'栄','rong' 
insert into @tb select'禸','rou' 
insert into @tb select'嶿','ru' 
insert into @tb select'撋','ruan' 
insert into @tb select'桵','rui' 
insert into @tb select'闰','run' 
insert into @tb select'叒','ruo' 
insert into @tb select'仨','sa' 
insert into @tb select'栍','saeng' 
insert into @tb select'毢','sai' 
insert into @tb select'虄','sal' 
insert into @tb select'三','san' 
insert into @tb select'桒','sang' 
insert into @tb select'掻','sao' 
insert into @tb select'色','se' 
insert into @tb select'裇','sed' 
insert into @tb select'聓','sei' 
insert into @tb select'森','sen' 
insert into @tb select'鬙','seng' 
insert into @tb select'閪','seo
insert into @tb select'縇','seon' 
insert into @tb select'杀','sha' 
insert into @tb select'筛','shai' 
insert into @tb select'山','shan' 
insert into @tb select'伤','shang' 
insert into @tb select'弰','shao' 
insert into @tb select'奢','she' 
insert into @tb select'申','shen' 
insert into @tb select'升','sheng' 
insert into @tb select'尸','shi' 
insert into @tb select'兙','shike' 
insert into @tb select'瓧','shiwa' 
insert into @tb select'収','shou' 
insert into @tb select'书','shu' 
insert into @tb select'刷','shua' 
insert into @tb select'摔','shuai' 
insert into @tb select'闩','shuan' 
insert into @tb select'双','shuang' 
insert into @tb select'谁','shei' 
insert into @tb select'脽','shui' 
insert into @tb select'吮','shun' 
insert into @tb select'哾','shuo' 
insert into @tb select'丝','si' 
insert into @tb select'螦','so' 
insert into @tb select'乺','sol' 
insert into @tb select'忪','song' 
insert into @tb select'凁','sou' 
insert into @tb select'苏','su' 
insert into @tb select'痠','suan' 
insert into @tb select'夊','sui' 
insert into @tb select'孙','sun' 
insert into @tb select'娑','suo' 
insert into @tb select'他','ta' 
insert into @tb select'襨','tae' 
insert into @tb select'囼','tai' 
insert into @tb select'坍','tan' 
insert into @tb select'铴','tang' 
insert into @tb select'仐','tao' 
insert into @tb select'畓','tap' 
insert into @tb select'忒','te' 
insert into @tb select'膯','teng' 
insert into @tb select'唞','teo' 
insert into @tb select'朰','teul' 
insert into @tb select'剔','ti' 
insert into @tb select'天','tian' 
insert into @tb select'旫','tiao' 
insert into @tb select'怗','tie' 
insert into @tb select'厅','ting' 
insert into @tb select'乭','tol' 
insert into @tb select'囲','tong' 
insert into @tb select'偷','tou' 
insert into @tb select'凸','tu' 
insert into @tb select'湍','tuan' 
insert into @tb select'推','tui' 
insert into @tb select'旽','tun' 
insert into @tb select'乇','tuo' 
insert into @tb select'屲','wa' 
insert into @tb select'歪','wai' 
insert into @tb select'乛','wan' 
insert into @tb select'尣','wang' 
insert into @tb select'危','wei' 
insert into @tb select'塭','wen' 
insert into @tb select'翁','weng' 
insert into @tb select'挝','wo' 
insert into @tb select'乌','wu' 
insert into @tb select'夕','xi' 
insert into @tb select'诶','ei' 
insert into @tb select'疨','xia' 
insert into @tb select'仙','xian' 
insert into @tb select'乡','xiang' 
insert into @tb select'灱','xiao' 
insert into @tb select'楔','xie' 
insert into @tb select'心','xin' 
insert into @tb select'星','xing' 
insert into @tb select'凶','xiong' 
insert into @tb select'休','xiu' 
insert into @tb select'旴','xu' 
insert into @tb select'昍','xuan' 
insert into @tb select'疶','xue' 
insert into @tb select'坃','xun' 
insert into @tb select'丫','ya' 
insert into @tb select'咽','yan' 
insert into @tb select'欕','eom' 
insert into @tb select'央','yang' 
insert into @tb select'吆','yao' 
insert into @tb select'椰','ye' 
insert into @tb select'膶','yen' 
insert into @tb select'一','yi' 
insert into @tb select'乁','i' 
insert into @tb select'乚','yin' 
insert into @tb select'应','ying' 
insert into @tb select'哟','yo' 
insert into @tb select'佣','yong' 
insert into @tb select'优','you' 
insert into @tb select'迂','yu' 
insert into @tb select'囦','yuan' 
insert into @tb select'曰','yue' 
insert into @tb select'蒀','yun' 
insert into @tb select'帀','za' 
insert into @tb select'災','zai' 
insert into @tb select'兂','zan' 
insert into @tb select'牂','zang' 
insert into @tb select'遭','zao' 
insert into @tb select'啫','ze' 
insert into @tb select'贼','zei' 
insert into @tb select'怎','zen' 
insert into @tb select'曽','zeng' 
insert into @tb select'吒','zha' 
insert into @tb select'甴','gad' 
insert into @tb select'夈','zhai' 
insert into @tb select'毡','zhan' 
insert into @tb select'张','zhang' 
insert into @tb select'钊','zhao' 
insert into @tb select'蜇','zhe' 
insert into @tb select'贞','zhen' 
insert into @tb select'凧','zheng' 
insert into @tb select'之','zhi' 
insert into @tb select'中','zhong' 
insert into @tb select'州','zhou' 
insert into @tb select'劯','zhu' 
insert into @tb select'抓','zhua' 
insert into @tb select'专','zhuan' 
insert into @tb select'转','zhuai' 
insert into @tb select'妆','zhuang' 
insert into @tb select'骓','zhui' 
insert into @tb select'宒','zhun' 
insert into @tb select'卓','zhuo' 
insert into @tb select'孜','zi' 
insert into @tb select'唨','zo' 
insert into @tb select'宗','zong' 
insert into @tb select'棸','zou' 
insert into @tb select'哫','zu' 
insert into @tb select'劗','zuan' 
insert into @tb select'厜','zui' 
insert into @tb select'尊','zun' 
insert into @tb select'昨','zuo' 
 
declare @strlong int 
select @strlong=len(@str),@return=''
while @strlong>0
begin   
      select top 1 @return=UPPER(substring(py,1,1) )+substring(py,2,len(py))+@return,@strlong=@strlong-1 
      from @tb a where chr<=substring(@str,@strlong,1) 
      order by chr collate Chinese_PRC_CS_AS_KS_WS desc 
      if @@rowcount=0
        select @return=substring(@str,@strlong,1)+@return,@strlong=@strlong-1
   end
return(@return)
end
关键词:SQL拼音

[错误报告] [推荐] [收藏] [打印] [关闭] [返回顶部]

  • 验证码:

最新图片文章

最新文章