I realise what I'm asking for may be impossible. I want to perform an UPDATE on two separate tables based on a LEFT JOIN and a WHERE clause. This is my attempt:
UPDATE PERIODDATES as pd, periods2 as p2
SET pd.[PERIODCODE] = @PERIODCODE,
p2.[USERCODE] = @USERCODE
left join periods2 AS p2
ON pdates.schemeid = p2.schemeid AND
WHERE [SCHEMEID] = @SCHEMEID
Is this possible?