If only one row is affected, it can be done without a table variable.
DECLARE @id INT
UPDATE Foo
SET Bar = 1, @id = id
WHERE Baz = 2
SELECT @id
If only one row is affected, it can be done without a table variable.
DECLARE @id INT
UPDATE Foo
SET Bar = 1, @id = id
WHERE Baz = 2
SELECT @id