How to obtain the Pinyin consonant of Chinese character string in sqlServer
How to get the pinyin consonant of Chinese character string in sqlServer, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
CREATE function fGetPy (@ str varchar) ='') returns varchar as begin declare @ strlen int,@return varchar, @ ii int declare @ c nchar (1), @ chn nchar (1) select @ strlen=len (@ str), @ return='' @ ii=0 set @ ii=0 while @ ii=' A 'select @ c = char (count (*) + 63) from (select top 27 * from (select chn =' A 'union all select' 8 'union all select' ZAM 'union all select' union all select''union all select' hair 'union all select', 'union all select' hafnium 'union all select'-- because have no 'i'union all select 'not' union all select 'union all select', 'union all select' union all' Select 'union all select' Oh, 'union all select', 'union all select', three 'union all select,' he 'union all select', no'u' union all select','no'v 'union all select', 'union all select' union all select, 'union all select', 'union all select @ chn) as an order by chn COLLATE Chinese_PRC_CI_AS) as b where b.chn