Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Using Update Command Multi Tables

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-04-09 : 12:28:53
Smitty writes "I am trying to update a newly create table with info from another. Can't get to work. Here is code.

Update Benefitstrh
Set Benefitstrh.PTO = Paydndb.dn_amt_xx
Where Benefitstrh.ssn = Paydndb.ssn
and Paydndb.dn_numb in ('40');

Any ideas?"

TSQLMan
Posting Yak Master

160 Posts

Posted - 2004-04-09 : 12:58:25
What error message are you getting, or are you just returning 0 records?
Go to Top of Page

TSQLMan
Posting Yak Master

160 Posts

Posted - 2004-04-09 : 12:59:35
The Create statemnet (DDL) for the table would be nice as well.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-04-09 : 13:10:08
UPDATE b
SET b.PTO = p.dn_amt_xx
FROM Benefitstrh b
INNER JOIN Paydndb p
ON b.ssn = p.ssn
WHERE p.dn_num = '40'

Tara
Go to Top of Page
   

- Advertisement -