I am trying to write a query to update multiple tables. Here it is:
DECLARE @old_team_id AS int;
DECLARE @new_team_id AS int;
UPDATE Players
SET team_id = @ new_team_id WHERE team_id = old_team_id
UPDATE managers
SET team_id = @ new_team_id WHERE team_id = old_team_id
UPDATE draft
SET owner_id = @newteam_id WHERE owner_id = @old_team_id AND year > year(getdate())
Im pretty green when it comes to SQL so if im way off please tell me the best way to do this.
Thank you in advance.
-Bill