well from your sample data....declare @table1 table (id int,column1 varchar(20),column2 varchar(20))declare @table2 table (id int,column1 int,column2 varchar(20))insert into @table1select 1, 'hi',null union all select 2, 'bye',null union all select 3, 'why', nullunion all select 4, 'no',null union all select 5, 'yes', null insert into @Table2 select 6, 1, 'nokia'union all select 7, 2, 'sony'union all select 8, 3, 'canon'union all select 9, 4, 'philips'union all select 10, 5, 'pioneer'update a set column2 = b.column2from @Table1 a join @Table2 b on a.ID = b.column1select * from @table1(5 row(s) affected)id column1 column2----------- -------------------- --------------------1 hi nokia 2 bye sony 3 why canon 4 no philips 5 yes pioneer
Em