Copy Code code as follows:
CREATE function fgetpy (@str varchar (500) = ')
Returns varchar (500)
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 < @strlen
Begin
Select @ii = @ii +1, @chn =substring (@str, @ii, 1)
If @chn >= ' Acridine '
Select @c = char (count (*) +63) from (
Select top of * FROM (
Select CHN = ' Acridine '
UNION ALL select ' Eight '
UNION ALL select ' Cha '
UNION ALL SELECT ' 咑 '
UNION ALL SELECT ' 妸 '
UNION ALL SELECT ' Send '
UNION ALL SELECT ' There '
UNION ALL SELECT ' Hafnium '
UNION ALL SELECT ' No '--because have no ' i '
UNION ALL SELECT ' No '
UNION ALL select ' Ka '
UNION ALL select ' garbage '
UNION ALL SELECT ' 嘸 '
UNION ALL SELECT ' 拏 '
UNION ALL select ' Oh '
UNION ALL SELECT ' 妑 '
UNION ALL select ' Seven '
UNION ALL SELECT ' 呥 '
UNION ALL select ' sa '
UNION ALL SELECT ' he '
UNION ALL SELECT ' 屲 '--no ' u '
UNION ALL SELECT ' 屲 '--no ' V '
UNION ALL SELECT ' 屲 '
UNION ALL select ' XI '
UNION ALL select ' Ya '
UNION ALL SELECT ' 帀 '
UNION ALL Select @chn
) as a
ORDER by CHN COLLATE Chinese_prc_ci_as) as B
where B.chn <= @chn
else set @c= @chn
Set @return = @return +@c
End
Return (@return)
End