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
  • 相关阅读:
    Hybrid 实验
    Access+Trunk 配置
    JS 超类和子类
    javascript高级程序设计第3版——第一章概括
    js 获取getElementsTagName()方法返回值的内容
    js 数组的pop(),push(),shift(),unshift()方法小结
    js parseInt()与Number()区别
    HTML中引用外部JS文件失效原因
    TP5报错 User qdm813229266 already has more than 'max_user_connections' active connections 解决办法
    微信内打开链接,跳转到公众号关注页面
  • 原文地址:https://www.cnblogs.com/cpine/p/2123969.html
Copyright © 2011-2022 走看看