Solved

Update table value with join syntax

Posted on 2016-09-01
2
60 Views
Last Modified: 2016-09-01
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
Comment
Question by:amucinobluedot
2 Comments
 
LVL 12

Accepted Solution

by:
funwithdotnet earned 500 total points
ID: 41780864
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
 

Author Closing Comment

by:amucinobluedot
ID: 41780871
Thx!
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now