If I understand your question correctly, you can place the assignment inside the
SELECT
clause. Consider the following example
DECLARE @name varchar(10)
DECLARE @id int;
SELECT @name = s.name,
@id = s.id
FROM sysobjects s
WHERE s.id = (SELECT max(a.id) FROM sysobjects a)
PRINT @name
PRINT @id