Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Update Query bulk

Author  Topic 

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2008-07-07 : 12:59:09
I have 2 tables (table1 and table2)

Update table1 set katalan = (table2's katalan field info) where table1.mykey = table2.mykey

but, i have almost 980 identical number of records in both table1 and table2. how can i execute an update statement so that all of the 980 records of katalan fields information gets updated from table2.katalan to table1.katalan field using where condition table1.mykey = table2.mykey.

Please help thank you very much for the information.

jdaman
Constraint Violating Yak Guru

354 Posts

Posted - 2008-07-07 : 13:08:08
[code]update table1
set katalan = t2.katalan
from table1 t1
join table2 t2 on t1.mykey = t2.mykey[/code]
Go to Top of Page
   

- Advertisement -