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)
 Relational update via SQL 2000

Author  Topic 

kakikupart
Starting Member

11 Posts

Posted - 2009-10-30 : 07:32:26
How to update via SQL 2000 if i have situation like this?

update payment set Payment.OrderNo=Salesorder.OrderNo where
Payment.OrderNo=Salesorder.InvoiceNumber

Yr help appreciated ...
Dwen

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-10-30 : 08:30:54
update p
set OrderNo = s.OrderNo
from Payment p
join Salesorder s on s.InvoiceNumber = p.OrderNo

Looks like this statement can be done only one time!
Because after that statement the relation between that tables on InvoiceNumber = OrderNo is gone away!


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -