zoukankan      html  css  js  c++  java
  • SQL Server 获取汉语拼音简码

    alter FUNCTION 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
  • 相关阅读:
    进度条加载
    插件
    倒计时
    阿里云oss教程
    拖拽排序插件 ---- Dragula
    预览图片代码
    Error: spawn xxxx ENOENT原因与解决
    关于环境配置的随笔
    js下载文件
    QuickStart系列:docker部署之redis
  • 原文地址:https://www.cnblogs.com/cpine/p/2123969.html
Copyright © 2011-2022 走看看