create table at(id int ,cap char(10) default(''))
create table bt(id int ,cap char(10))
declare @i int
set @i=1
while @i<100
begin
insert into at values(@i,default)
set @i= @i+1
end
set @i=1
while @i<100
begin
insert into bt values(@i,'aa'+cast(@i as char(4)) )
set @i= @i+1
end
update at set at.cap =bt.cap from at,bt where at.id=bt.id
select * from at
select * from bt