Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 93
  • Last Modified:

Update table value with join syntax

I have two tables that have a common field (to join)

Table 1:  Forms
Field 1: FormName (varchar 40)
Field 2: FormDesc (varchar 255)

Table 2: FormsCatalog
Field1: FormName (varchar 40)
Field 2: FormDesc (varchar 255)

I want to join both tables b the FormName, which is the same in both. And update the table 2 field 2 with the value of table 1 field 2

Something like

Update Formscatalog a
set a. FormDesc = b.FormDesc
where a.Formname JOINED TO b.FormName
and Forms as b

Open in new window


Obviously the syntax is incorrect, this is what I need help with. Simply join the tables by the name and have formscatalog.description be the same as forms.description

Hope I explained myself well.
0
Aleks
Asked:
Aleks
1 Solution
 
funwithdotnetCommented:
In T-SQL, I think something like this may be what you want:
Update a
set a.FormDesc = b.FormDesc
FROM Formscatalog a
INNER JOIN Forms b on b.FormName = a.FormName

Open in new window

0
 
AleksAuthor Commented:
Thx!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now