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

x
?
Solved

Need some help on update

Posted on 2006-11-23
2
Medium Priority
?
246 Views
Last Modified: 2008-03-04
I have a temp table with a field fname and email.
and I need to update my tbl_user with the fname from the temp table where the email matches the email from the temp table.

here is my SQL

update tbl_user set fname =
(select fname from tbl_temp where tbl_temp.email = tbl_user.email)
where tbl_user.email = tbl_temp.email

and I'm getting an error

Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "tbl_temp.email" could not be bound.
0
Comment
Question by:Ennio
[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 75

Expert Comment

by:Aneesh Retnakaran
ID: 18004254
update tu set fname =  tt.fname
from tbl_user tu
inner join tbl_temp on tbl_temp.email = tbl_user.email
where tbl_user.email = tbl_temp.email
0
 
LVL 14

Accepted Solution

by:
mherchl earned 2000 total points
ID: 18004258
update tbl_user set fname = tbl_temp.fname
from tbl_user
join tbl_temp on tbl_temp.email = tbl_user.email
0

Featured Post

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

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.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

660 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