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)
 Help with SQL 2005 update statement

Author  Topic 

Jpack23
Starting Member

1 Post

Posted - 2007-10-11 : 14:51:16
Hi,

I need to update Multiple columns in one table with corresponding data from another table.

example
Table A

Col1
Col2
Col3
Col4
Col5

Table B
ColA
ColB
ColC
ColD
ColE

need to update TableA.Col3,TableA.Col4,TableA.Col5
with Data From TableB.ColC,TableB.ColD,TableB.ColE
Where TableB.ColA = TableA.Col1

Thanks you very much for your time and help

j

PurpleSun
Yak Posting Veteran

50 Posts

Posted - 2007-10-11 : 16:53:33
update TableA set col3 = colC, col4 = colD from TableB inner join TableA on TableB.colA = TableA.col1
Go to Top of Page
   

- Advertisement -