Re: How to update a table using Join with other table
From: Vishal Parkar (REMOVE_THIS_vgparkar_at_yahoo.co.in)
Date: 03/22/04
- Next message: Daniel P.: "Natural vs. Surrogate key"
- Previous message: Stefan Delmarco [MSFT]: "Re: Active Directory Users"
- In reply to: Prabhat: "How to update a table using Join with other table"
- Next in thread: Prabhat: "Re: How to update a table using Join with other table"
- Reply: Prabhat: "Re: How to update a table using Join with other table"
- Reply: Hugo Kornelis: "Re: How to update a table using Join with other table"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 22 Mar 2004 21:39:39 +0530
try:
begin transaction
UPDATE a SET PHONENUM = STUFF(A.PHONENUM, 1, 3, B.NEW_NPA)
from company A INNER JOIN phonelist B
ON SUBSTRING(A.PHONENUM,1,3) = B.OLD_NPA
AND SUBSTRING(A.PHONENUM,4,3) = B.PREFIX
--check the data and commit/rollback accordingly
-- Vishal Parkar vgparkar@yahoo.co.in
- Next message: Daniel P.: "Natural vs. Surrogate key"
- Previous message: Stefan Delmarco [MSFT]: "Re: Active Directory Users"
- In reply to: Prabhat: "How to update a table using Join with other table"
- Next in thread: Prabhat: "Re: How to update a table using Join with other table"
- Reply: Prabhat: "Re: How to update a table using Join with other table"
- Reply: Hugo Kornelis: "Re: How to update a table using Join with other table"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|