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 |
|
liangtp@hotmail.com
Starting Member
27 Posts |
Posted - 2008-09-10 : 05:48:07
|
| Guys, I have a tblA with the following fields:IDNo, Name1, NULL2, Michael Phelps3, NULL4, Usain BoltI have another tblB with complete information:IDNo, Name1, Bill Gates2, Michael Phelps3, Ben Johnson4, Usain Bolt.Question: how do I write an SQL statement to update the NULL values in tblA with the values in tblB, using IDNo as the link?Thanks. |
|
|
sunil
Constraint Violating Yak Guru
282 Posts |
Posted - 2008-09-10 : 05:52:30
|
| Try,Update tblA SET tblA.NAME=tblB.Name FROM tblA INNER JOIN tblB ON tblA.IDNO=tblB.IDNO WHERE tblA.NAME IS NULL |
 |
|
|
liangtp@hotmail.com
Starting Member
27 Posts |
Posted - 2008-09-10 : 06:04:22
|
| Thanks Sunil. It worked. Cheers. |
 |
|
|
|
|
|