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