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)
 UPDATE statement from SELECT

Author  Topic 

neil
Starting Member

29 Posts

Posted - 2004-04-15 : 08:09:46

Is it possible to update a record from select statement like insert..select. or would I have to write a select statement and then do a seperate update based on the results.

Thanks

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-04-15 : 08:16:44
YOU can treat the UPDATE statement like a select STATEMENT

eg

UPDATE a
SET Col1 = b.Col2
FROM MyTable a
JOIN MyOtherTable b
on a.ID = b.ID



Is that what you are looking for?


Duane.
Go to Top of Page
   

- Advertisement -