create table #ke
(id char(20) primary key ,title char (300))insert into #ke
select '1a','a'
union
select '1b','b'
union
select 1,3
union
select 2,4
union
select 3,'a'select id,'['+rtrim(id)+']'+title as title from #ke
(id char(20) primary key ,title char (300))insert into #ke
select '1a','a'
union
select '1b','b'
union
select 1,3
union
select 2,4
union
select 3,'a'select id,'['+rtrim(id)+']'+title as title from #ke
set title='['+id+']'+substring(title,charindex(']',title)+1,8000)