DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Update TableA Using Value From TableB

11.23.2009
| 2456 views |
  • submit to reddit
        // Update a table using values from another table by joining on the PK

UPDATE 
	cx 
SET 
	cx.DeliveryDay = c.DeliveryDay
FROM 
	SV_CustomerExtended cx 
		INNER JOIN OM_Customer c 
			ON (cx.CustomerID = c.CustomerID);
GO