判断是否有英文

来源:互联网 发布:淘宝电脑可靠么 编辑:程序博客网 时间:2024/04/29 00:57

declare @center_stano varchar(300)
declare @loc_code_in varchar(20)

declare @i int
declare @tempchar varchar(200)
set @tempchar='*A'
set @i=ascii('B')
while @i<=ascii('Z')
begin
 set @tempchar=@tempchar+'*,*'+char(@i)
 --print @tempchar
set @i=@i+1
end

set @tempchar=@tempchar+'*'

set @center_stano=@tempchar
set @loc_code_in='a'
if (charindex(upper('*'+@loc_code_in+'*'),@center_stano)>0)
begin
      set @center_stano=@center_stano
 print '是中心代码'
end else begin
      set @center_stano=@loc_code_in
end


print @center_stano 

原创粉丝点击