Advertisement

07.06.2008 at 01:43PM PDT, ID: 23542015
[x]
Attachment Details

SQL UPDATE table from another table

Asked by garethh86 in SQL Query Syntax, SQL Server 2005

Tags: SQL

Hi there

I'm trying to update a field in one table from another table in a different db, this is what i tried and it comes back saying 500+ ropws successfull but nothign has changed. Can someone point out where I'm going wrong?

update xfer
set custid = myDB2.dbo.customers.custid
from xfer, myDB2.dbo.customers
where xfer.email = myDB2.dbo.customers.emailaddress

I'm trying to set the CustID in xfer to the custid in customers so long as the email address matches.

Thanks!
Start Free Trial
[+][-]07.06.2008 at 01:54PM PDT, ID: 21941592

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.06.2008 at 01:56PM PDT, ID: 21941597

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Query Syntax, SQL Server 2005
Tags: SQL
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.06.2008 at 02:06PM PDT, ID: 21941638

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.06.2008 at 02:11PM PDT, ID: 21941655

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.06.2008 at 02:14PM PDT, ID: 21941664

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628