摘要: 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 @PY=@PY+(case when unicode(@word) between 19968 and 19968+20901 then (select top 1 PY from 阅读全文
posted @ 2013-06-17 14:41 文刀君 阅读(234) 评论(0) 推荐(0) 编辑
摘要: IF OBJECT_ID('[fn_GetPinyin]') IS NOT NULLDROP FUNCTION [fn_GetPinyin]GOcreate function [dbo].[fn_GetPinyin](@words nvarchar(2000))returns varchar(8000)asbegindeclare @word nchar(1)declare @pinyin varchar(8000)declare @i intdeclare @words_len intdeclare @unicode intset @i = 1set @words = ltr 阅读全文
posted @ 2013-06-17 14:15 文刀君 阅读(282) 评论(0) 推荐(0) 编辑