Home Forums Article Discussions Article Discussions by Author Discuss Content Posted by Gregory Larsen stairway to T-SQL DML Level 10: Changing Data with the UPDATE Statement RE: stairway to T-SQL DML Level 10: Changing Data with the UPDATE Statement
Mr.DiGi
SSC Enthusiast
Points: 105
More actions
October 10, 2012 at 12:34 am
#1547475
I like "less magic" - you can update table alias:
UPDATE
P
SET
ProductName = N.ProductName,
Price = N.Price
FROM
dbo.Product P
INNER JOIN
dbo.New_Prices N ON P.ID = N.ID;
This is great when you join "Product" table more than once.