• 转换拼音简码


    执行:dbo.FB_GetChineseSpell(chzxm)

    CREATE FUNCTION [dbo].[FB_GetChineseSpell]
    (
    @Str varchar(500)=''
    )
    RETURNS varchar(500)
    as
    begin
    declare @strLen int
    declare @index int
    declare @VChControl char(2)
    DECLARE @VChSpell VARCHAR(30)
    declare @return varchar(500)
    set @return=''
    set @strlen=len(@str)
    set @index=1
    while @index<=@strlen
    begin
    select @VChControl=substring(@str,@index,1)
    IF @VChControl>'啊' AND @VChControl<'芭'
    SELECT @VChSpell='A'
    ELSE IF @VChControl>='芭' AND @VChControl<'擦'
    SELECT @VChSpell='B'
    ELSE IF @VChControl>='擦' AND @VChControl<'搭'
    SELECT @VChSpell='C'
    ELSE IF @VChControl>='搭' AND @VChControl<'娥'
    SELECT @VChSpell='D'
    ELSE IF @VChControl>='娥' AND @VChControl<'发'
    SELECT @VChSpell='E'
    ELSE IF @VChControl>='发' AND @VChControl<='嘎'
    SELECT @VChSpell='F'
    ELSE IF @VChControl>'嘎' AND @VChControl<'哈'
    SELECT @VChSpell='G'
    ELSE IF @VChControl>='哈' AND @VChControl<'击'
    SELECT @VChSpell='H'
    ELSE IF @VChControl>='击' AND @VChControl<'喀'
    SELECT @VChSpell='J'
    ELSE IF @VChControl>='喀' AND @VChControl<'垃'
    SELECT @VChSpell='K'
    ELSE IF @VChControl>='垃' AND @VChControl<'妈'
    SELECT @VChSpell='L'
    ELSE IF @VChControl>='妈' AND @VChControl<'拿'
    SELECT @VChSpell='M'
    ELSE IF @VChControl>='拿' AND @VChControl<'哦'
    SELECT @VChSpell='N'
    ELSE IF @VChControl>='哦' AND @VChControl<'啪'
    SELECT @VChSpell='O'
    ELSE IF @VChControl>='啪' AND @VChControl<'期'
    SELECT @VChSpell='P'
    ELSE IF @VChControl>='期' AND @VChControl<'然'
    SELECT @VChSpell='Q'
    ELSE IF @VChControl>='然' AND @VChControl<'撒'
    SELECT @VChSpell='R'
    ELSE IF @VChControl>='撒' AND @VChControl<'塌'
    SELECT @VChSpell='S'
    ELSE IF @VChControl>='塌' AND @VChControl<'挖'
    SELECT @VChSpell='T'
    ELSE IF @VChControl>='挖' AND @VChControl<'昔'
    SELECT @VChSpell='W'
    ELSE IF @VChControl>='昔' AND @VChControl<'压'
    SELECT @VChSpell='X'
    ELSE IF @VChControl>='压' AND @VChControl<'匝'
    SELECT @VChSpell='Y'
    ELSE IF @VChControl>='匝' AND @VChControl<='座'
    SELECT @VChSpell='Z'
    ELSE
    SELECT @VChSpell=@VChControl

    SELECT @return=@return + RTRIM(UPPER(@VChSpell))
    set @index=@index+1
    end
    return(@return)
    end

  • 相关阅读:
    JimuReport积木报表 v1.4.3版本发布,免费的可视化低代码报表
    2022国内低代码平台厂商排行榜—经典收藏
    sql server2005 无法修改表,超时时间已到 在操作完成之前超时时
    试下C# 8.0 的switch表达式 (VS2019)
    vue项目部署在IIS上面的心得
    使用MultipleActiveResultSets复用Sql Server 2008数据库连接
    C# Func<>委托
    你是如何学会正则表达式的?
    Kibana:Windows下安装和运行Kibana
    Elasticsearch(ES)各版本的下载安装与Kibana各版本的下载安装
  • 原文地址:https://www.cnblogs.com/ljsjxr/p/5510877.html
Copyright © 2020-2023  润新知