I have four tables (simplified version)
Clients:
ClientID
ManagerID
UserID
VolunteerID
Managers
ManagerID
TeamID
Users
UserID
Teams
TeamID
I need to to update the user ID (Client.UserID) on a particular Client for a particular Team
I have come up with the following but it doesnt seem to be working - the user ID on the client is not being altered:
UPDATE C
SET C.UserID = 28
FROM vTeams T
INNER JOIN Vmanagers M ON T.TeamID = M.TeamID
INNER JOIN dbo.vClients C ON M.ManagerID = C.ManagerID
INNER JOIN vUsers U ON C.UserID = U.UserID
WHERE
T.TeamID = 251
TIA