Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Update table value with join syntax

Posted on 2016-09-01
2
Medium Priority
?
89 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
funwithdotnet earned 2000 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

722 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