How can I do an UPDATE statement with JOIN in SQL Server?
Asked 07 September, 2021
Viewed 2.6K times
  • 63
Votes

I need to update this table in SQL Server with data from its 'parent' table, see below:

Table: sale

id (int)
udid (int)
assid (int)

Table: ud

id  (int)
assid  (int)

sale.assid contains the correct value to update ud.assid.

What query will do this? I'm thinking of a join but I'm not sure if it's possible.

16 Answer