Create function [dbo]. [FUN_GETBH] (@char nchar (2))
returns int
As
Begin
Return
case where Unicode (@char) between 19968 and 40869 then (
Select top 1 ID from (
Select Id=1,ch=n ' sanctioned '
UNION ALL select 2,n ' 阝 '
UNION ALL select 3,n ' horse '
UNION ALL select 4,n ' Wind '
UNION ALL select 5,n ' Dragon '
UNION ALL select 6,n ' Qi '
UNION ALL select 7,n ' Turtle '
UNION ALL select 8,n ' teeth '
UNION ALL select 9,n ' poison '
UNION ALL select 10,n ' ageing '
UNION ALL select 11,n ' niches '
UNION ALL select 12,n ' 龂 '
UNION ALL select 13,n ' Nightmares '
UNION ALL select 14,n ' Gum '
UNION ALL select 15,n ' looser '
UNION ALL select 16,n ' Dragon '
UNION ALL select 17,n ' Yue '
UNION ALL select 18,n ' 龎 '
UNION ALL select 19,n ' Bond '
UNION ALL select 20,n ' Qiuyan '
UNION ALL select 21,n ' 龡 '
UNION ALL select 22,n ' Kotewall '
UNION ALL select 23,n ' 龝 '
UNION ALL select 24,n ' 齹 '
UNION ALL select 25,n ' 龣 '
UNION ALL select 26,n ' calls '
UNION ALL select 27,n ' 齈 '
UNION ALL select 28,n ' 龞 '
UNION ALL select 29,n ' 麷 '
UNION ALL select 30,n ' 鸞 '
UNION ALL select 31,n ' 麣 '
UNION ALL select 32,n ' 龖 '
UNION ALL select 33,n ' 龗 '
UNION ALL select 35,n ' 齾 '
UNION ALL select 36,n ' Snuffle '
UNION ALL select 39,n ' 靐 '
UNION ALL select 64,n ' Tantrayana '
) A where ch>[email protected] collate CHINESE_PRC_STROKE_CS_AS_KS_WS
Order BY ID ASC)
else 0 End)
End
--Test example
Select DBO.FUN_GETBH (' Zhang ')
SQL Server calculates stroke function for Chinese characters