******IMPORTANT NOTE******
Only now after a few years of comments, I understand the big confusion I generated, and I understand it's been my fault and for that I do apologize.
The query works but NOT in MSSMS: the query works in ASP or in a Ms Access environment with linked tables to MS SQL. I hope this clarify a bit...
Sometimes, when searching for an answer, we end up making things too much complicated, while easy solutions are just round the corner. This is the case of a simple task like updating two related tables with just one SQL query.
Suppose we have two related tables. The first contains user names, and the second email addresses related to the first table names.
First table ("names")
| ID | name |
| 1 | John |
| 2 | James |
The second table ("addresses")
| ID | address |
| 1 | First Street |
| 2 | Second Street |
How do we change the name and the street of the first record (with id equal to 1)?
With one simple query.