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.
Author |
Topic |
minhle
Starting Member
4 Posts |
Posted - 2011-11-21 : 05:09:33
|
I have two table:Table A (ID, field1, field2)Table B (ID, field2, field3)I would link to replace value of field 2 of B into field 2 of A where A.ID = B.IDI write query in SQL 2005 as belowsUpdate (select A.*, B.* from A, B where (A.ID=B.ID)) SET A.field2 = B.field2But my query is not working.Any one can have me? |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-21 : 05:13:54
|
it should beUpdate aset a.field2=b.field2from TableA ainner join TableB bon b.ID = a.ID ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|