sql server 2000, updating a table based on another table

Hi !
One of my tables lacks information that another table contains, telephone number
for example.
I'd like to update the column "Telephone" of table b wherby table a.
in the code:
select
a.telephone
b.telephone
from
t1 as a full join t2 as b
on
a.id=b.id
whenever t2 has an empty cell it should be updated and set with t1's value.
Can anyone show me how it can be done ?
Thanks !
[449 byte] By [PsSheba] at [2007-11-20 3:55:24]
# 1 Re: sql server 2000, updating a table based on another table
As far as I remember, it goes something like:

Update A
Set A.Telephone = B.Telephone
From T1 A
Inner Join T2 B
On A.Id = B.Id
Where A.Telephone Is Null

You need to try this on a test database, to confirm it works to your satisfaction.

HTH
jp140768 at 2007-11-9 13:44:34 >