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 2005 Forums
 Transact-SQL (2005)
 Update Field from another table

Author  Topic 

Steve2106
Posting Yak Master

183 Posts

Posted - 2011-05-19 : 12:13:28
Hi There,

In need of your help again.

I have 2 tables.
Table1: Fields= AutoId, Description, ProcId, ProcDesc
Table2: Fields- AutoId,Description

I would like to update Table1.ProcDesc = Table2.Description where Table1.ProcId = Table2.AutoId

Hope that makes sense.

Thanks for your help.

Best Regards,



Steve

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-05-19 : 12:36:05
You almost have the query written in your description:

UPDATE Table1 SET
ProcDesc = Table2.Description
FROM
Table1
INNER JOIN Table2 ON Table1.ProcId = Table2.AutoId
Go to Top of Page
   

- Advertisement -