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 |
|
Goalie35
Yak Posting Veteran
81 Posts |
Posted - 2011-08-25 : 15:57:35
|
| I have 2 tables (TableA and TableB). Both have the same field names but if certain fields in TableA are null, I need to populate that field with the value from TableBSo for example:Table A:ID | Name | Address-----------------------1 | John Smith | 123 Any St.2 | Amy Andrews | <null>Table B:ID | TableA_ID | Name | Address-------------------------------------------13 | 1 | John Smith | 123 Any St.18 | 56 | Peter Robbins | 18 Strathmore Ln.22 | 2 | Amy Andrews | 456 Park Ave.After running my update, my TableA should look as follows:TableA:ID | Name | Address-----------------------1 | John Smith | 123 Any St.2 | Amy Andrews | 456 Park Ave.What's the best way to make these updates to the null TableA fields?Thanks. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Goalie35
Yak Posting Veteran
81 Posts |
Posted - 2011-08-30 : 09:35:31
|
That worked, thanks! |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|