create table #t1 (c1 varchar(5))
insert into #t1 values ('3A')
insert into #t1 values ('1B')
insert into #t1 values ('2C')
declare @var varchar(100)
set @var = ''
select @var = @var + c1 + ','
from #t1
order by cast(SUBSTRING(c1, 0, len(c1)) as int)
select * from #t1
select cast(c1 as varchar)
from #t1
order by cast(SUBSTRING(c1, 0, len(c1)) as int)
select @var
drop table #t1
|