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 2000 Forums
 SQL Server Development (2000)
 Updating table from another table

Author  Topic 

makimark
Starting Member

34 Posts

Posted - 2001-07-21 : 07:57:48
Hi

I'm trying to update table1 from data found in table2. My problem is that the darn statement when executed updates all records and not just the ones that it should. I have included a where statement. Any ideas ?

Update Table1
set name = (Select name from table2
where table1.name = table2.name)

this will update the name=name field but sets all other fields in table1 to null. ????

   

- Advertisement -