/ Published in: SQL
SQL update examples using joins
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
UPDATE c SET ContactId = ac.contact_id FROM ATable AS c INNER JOIN BTable AS ac ON c.Contact = (ac.surname + ', ' + ac.forename) UPDATE c SET AreaCoordinator = cha.ContactId FROM dbo.ATable AS c INNER JOIN dbo.BTable AS cha ON c.County = cha.County